Theory AOT_PLM

1(*<*)
2theory AOT_PLM
3  imports AOT_Axioms
4begin
5(*>*)
6
7section‹The Deductive System PLM›
8
9(* constrain sledgehammer to the abstraction layer *)
10unbundle AOT_no_atp
11
12AOT_theorem "modus-ponens": assumes φ and φ  ψ shows ψ
13  using assms by (simp add: AOT_sem_imp) (* NOTE: semantics needed *)
14lemmas MP = "modus-ponens"
15
16AOT_theorem "non-con-thm-thm": assumes  φ shows  φ
17  using assms by simp
18
19AOT_theorem "vdash-properties:1[1]": assumes φ  Λ shows  φ
20  using assms unfolding AOT_model_act_axiom_def by blast (* NOTE: semantics needed *)
21
22text‹Convenience attribute for instantiating modally-fragile axioms.›
23attribute_setup act_axiom_inst =
24  ‹Scan.succeed (Thm.rule_attribute [] (K (fn thm => thm RS @{thm "vdash-properties:1[1]"})))
25  "Instantiate modally fragile axiom as modally fragile theorem."
26
27AOT_theorem "vdash-properties:1[2]": assumes φ  Λ shows  φ
28  using assms unfolding AOT_model_axiom_def by blast (* NOTE: semantics needed *)
29
30text‹Convenience attribute for instantiating modally-strict axioms.›
31attribute_setup axiom_inst =
32  ‹Scan.succeed (Thm.rule_attribute [] (K (fn thm => thm RS @{thm "vdash-properties:1[2]"})))
33  "Instantiate axiom as theorem."
34
35text‹Convenience methods and theorem sets for applying "cqt:2".›
36method cqt_2_lambda_inst_prover = (fast intro: AOT_instance_of_cqt_2_intro)
37method "cqt:2[lambda]" = (rule "cqt:2[lambda]"[axiom_inst]; cqt_2_lambda_inst_prover)
38lemmas "cqt:2" = "cqt:2[const_var]"[axiom_inst] "cqt:2[lambda]"[axiom_inst] AOT_instance_of_cqt_2_intro
39method "cqt:2" = (safe intro!: "cqt:2")
40
41AOT_theorem "vdash-properties:3": assumes  φ shows Γ  φ
42  using assms by blast
43
44AOT_theorem "vdash-properties:5": assumes Γ1  φ and Γ2  φ  ψ shows Γ1, Γ2  ψ
45  using MP assms by blast
46
47AOT_theorem "vdash-properties:6": assumes φ and φ  ψ shows ψ
48  using MP assms by blast
49
50AOT_theorem "vdash-properties:8": assumes Γ  φ and φ  ψ shows Γ  ψ
51  using assms by argo
52
53AOT_theorem "vdash-properties:9": assumes φ shows ψ  φ
54  using MP "pl:1"[axiom_inst] assms by blast
55
56AOT_theorem "vdash-properties:10": assumes φ  ψ and φ shows ψ
57  using MP assms by blast
58lemmas "→E" = "vdash-properties:10"
59
60AOT_theorem "rule-gen": assumes for arbitrary α: φ{α} shows α φ{α}
61  using assms by (metis AOT_var_of_term_inverse AOT_sem_denotes AOT_sem_forall) (* NOTE: semantics needed *)
62lemmas GEN = "rule-gen"
63
64AOT_theorem "RN[prem]": assumes Γ  φ shows Γ  φ
65  by (meson AOT_sem_box assms image_iff) (* NOTE: semantics needed *)
66AOT_theorem RN: assumes  φ shows φ
67  using "RN[prem]" assms by blast
68
69AOT_axiom "df-rules-formulas[1]": assumes φ df ψ shows φ  ψ
70  using assms by (simp_all add: AOT_model_axiomI AOT_model_equiv_def AOT_sem_imp) (* NOTE: semantics needed *)
71AOT_axiom "df-rules-formulas[2]": assumes φ df ψ shows ψ  φ
72  using assms by (simp_all add: AOT_model_axiomI AOT_model_equiv_def AOT_sem_imp) (* NOTE: semantics needed *)
73(* NOTE: for convenience also state the above as regular theorems *)
74AOT_theorem "df-rules-formulas[3]": assumes φ df ψ shows φ  ψ
75  using "df-rules-formulas[1]"[axiom_inst, OF assms].
76AOT_theorem "df-rules-formulas[4]": assumes φ df ψ shows ψ  φ
77  using "df-rules-formulas[2]"[axiom_inst, OF assms].
78
79
80AOT_axiom "df-rules-terms[1]":
81  assumes τ{α1...αn} =df σ{α1...αn}
82  shows (σ{τ1...τn}  τ{τ1...τn} = σ{τ1...τn}) & (¬σ{τ1...τn}  ¬τ{τ1...τn})
83  using assms by (simp add: AOT_model_axiomI AOT_sem_conj AOT_sem_imp AOT_sem_eq AOT_sem_not AOT_sem_denotes AOT_model_id_def) (* NOTE: semantics needed *)
84AOT_axiom "df-rules-terms[2]":
85  assumes τ =df σ
86  shows (σ  τ = σ) & (¬σ  ¬τ)
87  by (metis "df-rules-terms[1]" case_unit_Unity assms)
88(* NOTE: for convenience also state the above as regular theorems *)
89AOT_theorem "df-rules-terms[3]":
90  assumes τ{α1...αn} =df σ{α1...αn}
91  shows (σ{τ1...τn}  τ{τ1...τn} = σ{τ1...τn}) & (¬σ{τ1...τn}  ¬τ{τ1...τn})
92  using "df-rules-terms[1]"[axiom_inst, OF assms].
93AOT_theorem "df-rules-terms[4]":
94  assumes τ =df σ
95  shows (σ  τ = σ) & (¬σ  ¬τ)
96  using "df-rules-terms[2]"[axiom_inst, OF assms].
97
98
99AOT_theorem "if-p-then-p": φ  φ
100  by (meson "pl:1"[axiom_inst] "pl:2"[axiom_inst] MP)
101
102AOT_theorem "deduction-theorem": assumes φ  ψ shows φ  ψ
103  using assms by (simp add: AOT_sem_imp) (* NOTE: semantics needed *)
104lemmas CP = "deduction-theorem"
105lemmas "→I" = "deduction-theorem"
106
107AOT_theorem "ded-thm-cor:1": assumes Γ1  φ  ψ and Γ2  ψ  χ shows Γ1, Γ2  φ  χ
108  using "→E" "→I" assms by blast
109AOT_theorem "ded-thm-cor:2": assumes Γ1  φ  (ψ  χ) and Γ2  ψ shows Γ1, Γ2  φ  χ
110  using "→E" "→I" assms by blast
111
112AOT_theorem "ded-thm-cor:3": assumes φ  ψ and ψ  χ shows φ  χ
113  using "→E" "→I" assms by blast
114declare "ded-thm-cor:3"[trans]
115AOT_theorem "ded-thm-cor:4": assumes φ  (ψ  χ) and ψ shows φ  χ
116  using "→E" "→I" assms by blast
117
118lemmas "Hypothetical Syllogism" = "ded-thm-cor:3"
119
120AOT_theorem "useful-tautologies:1": ¬¬φ  φ
121  by (metis "pl:3"[axiom_inst] "→I" "Hypothetical Syllogism")
122AOT_theorem "useful-tautologies:2": φ  ¬¬φ
123  by (metis "pl:3"[axiom_inst] "→I" "ded-thm-cor:4")
124AOT_theorem "useful-tautologies:3": ¬φ  (φ  ψ)
125  by (meson "ded-thm-cor:4" "pl:3"[axiom_inst] "→I")
126AOT_theorem "useful-tautologies:4": (¬ψ  ¬φ)  (φ  ψ)
127  by (meson "pl:3"[axiom_inst] "Hypothetical Syllogism" "→I")
128AOT_theorem "useful-tautologies:5": (φ  ψ)  (¬ψ  ¬φ)
129  by (metis "useful-tautologies:4" "Hypothetical Syllogism" "→I")
130
131AOT_theorem "useful-tautologies:6": (φ  ¬ψ)  (ψ  ¬φ)
132  by (metis "→I" MP "useful-tautologies:4")
133
134AOT_theorem "useful-tautologies:7": (¬φ  ψ)  (¬ψ  φ)
135  by (metis "→I" MP "useful-tautologies:3" "useful-tautologies:5")
136
137AOT_theorem "useful-tautologies:8": φ  (¬ψ  ¬(φ  ψ))
138  by (metis "→I" MP "useful-tautologies:5")
139
140AOT_theorem "useful-tautologies:9": (φ  ψ)  ((¬φ  ψ)  ψ)
141  by (metis "→I" MP "useful-tautologies:6")
142
143AOT_theorem "useful-tautologies:10": (φ  ¬ψ)  ((φ  ψ)  ¬φ)
144  by (metis "→I" MP "pl:3"[axiom_inst])
145
146AOT_theorem "dn-i-e:1": assumes φ shows ¬¬φ
147  using MP "useful-tautologies:2" assms by blast
148lemmas "¬¬I" = "dn-i-e:1"
149AOT_theorem "dn-i-e:2": assumes ¬¬φ shows φ
150  using MP "useful-tautologies:1" assms by blast
151lemmas "¬¬E" = "dn-i-e:2"
152
153AOT_theorem "modus-tollens:1": assumes φ  ψ and ¬ψ shows ¬φ
154  using MP "useful-tautologies:5" assms by blast
155AOT_theorem "modus-tollens:2": assumes φ  ¬ψ and ψ shows ¬φ
156  using "¬¬I" "modus-tollens:1" assms by blast
157lemmas MT = "modus-tollens:1" "modus-tollens:2"
158
159AOT_theorem "contraposition:1[1]": assumes φ  ψ shows ¬ψ  ¬φ
160  using "→I" MT(1) assms by blast
161AOT_theorem "contraposition:1[2]": assumes ¬ψ  ¬φ shows φ  ψ
162  using "→I" "¬¬E" MT(2) assms by blast
163
164AOT_theorem "contraposition:2": assumes φ  ¬ψ shows ψ  ¬φ
165  using "→I" MT(2) assms by blast
166
167(* TODO: this is actually a mixture of the two variants given in PLM; adjust. *)
168AOT_theorem "reductio-aa:1":
169  assumes ¬φ  ¬ψ and ¬φ  ψ shows φ
170  using "→I" "¬¬E" MT(2) assms by blast
171AOT_theorem "reductio-aa:2":
172  assumes φ  ¬ψ and φ  ψ shows ¬φ
173  using "reductio-aa:1" assms by blast
174lemmas "RAA" = "reductio-aa:1" "reductio-aa:2"
175
176AOT_theorem "exc-mid": φ  ¬φ
177  using "df-rules-formulas[4]" "if-p-then-p" MP "conventions:2" by blast
178
179AOT_theorem "non-contradiction": ¬(φ & ¬φ)
180  using "df-rules-formulas[3]" MT(2) "useful-tautologies:2" "conventions:1" by blast
181
182AOT_theorem "con-dis-taut:1": (φ & ψ)  φ
183  by (meson "→I" "df-rules-formulas[3]" MP RAA(1) "conventions:1")
184AOT_theorem "con-dis-taut:2": (φ & ψ)  ψ
185  by (metis "→I" "df-rules-formulas[3]" MT(2) RAA(2) "¬¬E" "conventions:1")
186lemmas "Conjunction Simplification" = "con-dis-taut:1" "con-dis-taut:2"
187
188AOT_theorem "con-dis-taut:3": φ  (φ  ψ)
189  by (meson "contraposition:1[2]" "df-rules-formulas[4]" MP "→I" "conventions:2")
190AOT_theorem "con-dis-taut:4": ψ  (φ  ψ)
191  using "Hypothetical Syllogism" "df-rules-formulas[4]" "pl:1"[axiom_inst] "conventions:2" by blast
192lemmas "Disjunction Addition" = "con-dis-taut:3" "con-dis-taut:4"
193
194AOT_theorem "con-dis-taut:5": φ  (ψ  (φ & ψ))
195  by (metis "contraposition:2" "Hypothetical Syllogism" "→I" "df-rules-formulas[4]" "conventions:1")
196lemmas Adjunction = "con-dis-taut:5"
197
198AOT_theorem "con-dis-taut:6": (φ & φ)  φ
199  by (metis Adjunction "→I" "df-rules-formulas[4]" MP "Conjunction Simplification"(1) "conventions:3")
200lemmas "Idempotence of &" = "con-dis-taut:6"
201
202AOT_theorem "con-dis-taut:7": (φ  φ)  φ
203proof -
204  {
205    AOT_assume φ  φ
206    AOT_hence ¬φ  φ
207      using "conventions:2"[THEN "df-rules-formulas[3]"] MP by blast
208    AOT_hence φ using "if-p-then-p" RAA(1) MP by blast
209  }
210  moreover {
211    AOT_assume φ
212    AOT_hence φ  φ using "Disjunction Addition"(1) MP by blast
213  }
214  ultimately AOT_show (φ  φ)  φ
215    using "conventions:3"[THEN "df-rules-formulas[4]"] MP
216    by (metis Adjunction "→I")
217qed
218lemmas "Idempotence of ∨" = "con-dis-taut:7"
219
220
221AOT_theorem "con-dis-i-e:1": assumes φ and ψ shows φ & ψ
222  using Adjunction MP assms by blast
223lemmas "&I" = "con-dis-i-e:1"
224
225AOT_theorem "con-dis-i-e:2:a": assumes φ & ψ shows φ
226  using "Conjunction Simplification"(1) MP assms by blast
227AOT_theorem "con-dis-i-e:2:b": assumes φ & ψ shows ψ
228  using "Conjunction Simplification"(2) MP assms by blast
229lemmas "&E" = "con-dis-i-e:2:a" "con-dis-i-e:2:b"
230
231AOT_theorem "con-dis-i-e:3:a": assumes φ shows φ  ψ
232  using "Disjunction Addition"(1) MP assms by blast
233AOT_theorem "con-dis-i-e:3:b": assumes ψ shows φ  ψ
234  using "Disjunction Addition"(2) MP assms by blast
235AOT_theorem "con-dis-i-e:3:c": assumes φ  ψ and φ  χ and ψ  Θ shows χ  Θ
236  by (metis "con-dis-i-e:3:a" "Disjunction Addition"(2) "df-rules-formulas[3]" MT(1) RAA(1) "conventions:2" assms)
237lemmas "∨I" = "con-dis-i-e:3:a" "con-dis-i-e:3:b" "con-dis-i-e:3:c"
238
239AOT_theorem "con-dis-i-e:4:a": assumes φ  ψ and φ  χ and ψ  χ shows χ
240  by (metis MP RAA(2) "df-rules-formulas[3]" "conventions:2" assms)
241AOT_theorem "con-dis-i-e:4:b": assumes φ  ψ and ¬φ shows ψ
242  using "con-dis-i-e:4:a" RAA(1) "→I" assms by blast
243AOT_theorem "con-dis-i-e:4:c": assumes φ  ψ and ¬ψ shows φ
244  using "con-dis-i-e:4:a" RAA(1) "→I" assms by blast
245lemmas "∨E" = "con-dis-i-e:4:a" "con-dis-i-e:4:b" "con-dis-i-e:4:c"
246
247AOT_theorem "raa-cor:1": assumes ¬φ  ψ & ¬ψ shows φ
248  using "&E" "∨E"(3) "∨I"(2) RAA(2) assms by blast
249AOT_theorem "raa-cor:2": assumes φ  ψ & ¬ψ shows ¬φ
250  using "raa-cor:1" assms by blast
251AOT_theorem "raa-cor:3": assumes φ and ¬ψ  ¬φ shows ψ
252  using RAA assms by blast
253AOT_theorem "raa-cor:4": assumes ¬φ and ¬ψ  φ shows ψ
254  using RAA assms by blast
255AOT_theorem "raa-cor:5": assumes φ and ψ  ¬φ shows ¬ψ
256  using RAA assms by blast
257AOT_theorem "raa-cor:6": assumes ¬φ and ψ  φ shows ¬ψ
258  using RAA assms by blast
259
260(* TODO: note these need manual introduction rules *)
261AOT_theorem "oth-class-taut:1:a": (φ  ψ)  ¬(φ & ¬ψ)
262  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
263     (metis "&E" "&I" "raa-cor:3" "→I" MP)
264AOT_theorem "oth-class-taut:1:b": ¬(φ  ψ)  (φ & ¬ψ)
265  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
266     (metis "&E" "&I" "raa-cor:3" "→I" MP)
267AOT_theorem "oth-class-taut:1:c": (φ  ψ)  (¬φ  ψ)
268  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
269     (metis "&I" "∨I"(1, 2) "∨E"(3) "→I" MP "raa-cor:1")
270
271AOT_theorem "oth-class-taut:2:a": (φ & ψ)  (ψ & φ)
272  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
273     (meson "&I" "&E" "→I")
274lemmas "Commutativity of &" = "oth-class-taut:2:a"
275AOT_theorem "oth-class-taut:2:b": (φ & (ψ & χ))  ((φ & ψ) & χ)
276  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
277     (metis "&I" "&E" "→I")
278lemmas "Associativity of &" = "oth-class-taut:2:b"
279AOT_theorem "oth-class-taut:2:c": (φ  ψ)  (ψ  φ)
280  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
281     (metis "&I" "∨I"(1, 2) "∨E"(1) "→I")
282lemmas "Commutativity of ∨" = "oth-class-taut:2:c"
283AOT_theorem "oth-class-taut:2:d": (φ  (ψ  χ))  ((φ  ψ)  χ)
284  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"])
285     (metis "&I" "∨I"(1, 2) "∨E"(1) "→I")
286lemmas "Associativity of ∨" = "oth-class-taut:2:d"
287AOT_theorem "oth-class-taut:2:e": (φ  ψ)  (ψ  φ)
288  by (rule "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"]; rule "&I";
289      metis "&I" "df-rules-formulas[4]" "conventions:3" "&E" "Hypothetical Syllogism" "→I" "df-rules-formulas[3]")
290lemmas "Commutativity of ≡" = "oth-class-taut:2:e"
291AOT_theorem "oth-class-taut:2:f": (φ  (ψ  χ))  ((φ  ψ)  χ)
292  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
293        "→I" "→E" "&E" "&I"
294  by metis
295lemmas "Associativity of ≡" = "oth-class-taut:2:f"
296
297AOT_theorem "oth-class-taut:3:a": φ  φ
298  using "&I" "vdash-properties:6" "if-p-then-p" "df-rules-formulas[4]" "conventions:3" by blast
299AOT_theorem "oth-class-taut:3:b": φ  ¬¬φ
300  using "&I" "useful-tautologies:1" "useful-tautologies:2" "vdash-properties:6" "df-rules-formulas[4]" "conventions:3" by blast
301AOT_theorem "oth-class-taut:3:c": ¬(φ  ¬φ)
302  by (metis "&E" "→E" RAA "df-rules-formulas[3]" "conventions:3")
303
304AOT_theorem "oth-class-taut:4:a": (φ  ψ)  ((ψ  χ)  (φ  χ))
305  by (metis "→E" "→I")
306AOT_theorem "oth-class-taut:4:b": (φ  ψ)  (¬φ  ¬ψ)
307  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
308        "→I" "→E" "&E" "&I" RAA by metis
309AOT_theorem "oth-class-taut:4:c": (φ  ψ)  ((φ  χ)  (ψ  χ))
310  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
311        "→I" "→E" "&E" "&I" by metis
312AOT_theorem "oth-class-taut:4:d": (φ  ψ)  ((χ  φ)  (χ  ψ))
313  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
314        "→I" "→E" "&E" "&I" by metis
315AOT_theorem "oth-class-taut:4:e": (φ  ψ)  ((φ & χ)  (ψ & χ))
316  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
317        "→I" "→E" "&E" "&I" by metis
318AOT_theorem "oth-class-taut:4:f": (φ  ψ)  ((χ & φ)  (χ & ψ))
319  using "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
320        "→I" "→E" "&E" "&I" by metis
321AOT_theorem "oth-class-taut:4:g": (φ  ψ)  ((φ & ψ)  (¬φ & ¬ψ))
322proof(safe intro!: "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"] "&I" "→I"
323           dest!: "conventions:3"[THEN "df-rules-formulas[3]", THEN "→E"])
324  AOT_show φ & ψ  (¬φ & ¬ψ) if (φ  ψ) & (ψ  φ)
325    using "&E" "∨I" "→E" "&I" "raa-cor:1" "→I" "∨E" that by metis
326next
327  AOT_show ψ if φ & ψ  (¬φ & ¬ψ) and φ
328    using that "∨E" "&E" "raa-cor:3" by blast
329next
330  AOT_show φ if φ & ψ  (¬φ & ¬ψ) and ψ
331    using that "∨E" "&E" "raa-cor:3" by blast
332qed
333AOT_theorem "oth-class-taut:4:h": ¬(φ  ψ)  ((φ & ¬ψ)  (¬φ & ψ))
334proof (safe intro!: "conventions:3"[THEN "df-rules-formulas[4]", THEN "→E"] "&I" "→I")
335  AOT_show φ & ¬ψ  (¬φ & ψ) if ¬(φ  ψ)
336    by (metis that "&I" "∨I"(1, 2) "→I" MT(1) "df-rules-formulas[4]" "raa-cor:3" "conventions:3")
337next
338  AOT_show ¬(φ  ψ) if φ & ¬ψ  (¬φ & ψ)
339    by (metis that "&E" "∨E"(2) "→E" "df-rules-formulas[3]" "raa-cor:3" "conventions:3")
340qed
341AOT_theorem "oth-class-taut:5:a": (φ & ψ)  ¬(¬φ  ¬ψ)
342  using "conventions:3"[THEN "df-rules-formulas[4]"]
343        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
344AOT_theorem "oth-class-taut:5:b": (φ  ψ)  ¬(¬φ & ¬ψ)
345  using "conventions:3"[THEN "df-rules-formulas[4]"]
346        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
347AOT_theorem "oth-class-taut:5:c": ¬(φ & ψ)  (¬φ  ¬ψ)
348  using "conventions:3"[THEN "df-rules-formulas[4]"]
349        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
350AOT_theorem "oth-class-taut:5:d": ¬(φ  ψ)  (¬φ & ¬ψ)
351  using "conventions:3"[THEN "df-rules-formulas[4]"]
352        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
353
354lemmas DeMorgan = "oth-class-taut:5:c" "oth-class-taut:5:d"
355
356AOT_theorem "oth-class-taut:6:a": (φ & (ψ  χ))  ((φ & ψ)  (φ & χ))
357  using "conventions:3"[THEN "df-rules-formulas[4]"]
358        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
359AOT_theorem "oth-class-taut:6:b": (φ  (ψ & χ))  ((φ  ψ) & (φ  χ))
360  using "conventions:3"[THEN "df-rules-formulas[4]"]
361        "→I" "→E" "&E" "&I" "∨I" "∨E" RAA by metis
362
363AOT_theorem "oth-class-taut:7:a": ((φ & ψ)  χ)  (φ  (ψ  χ))
364  by (metis "&I" "→E" "→I")
365lemmas Exportation = "oth-class-taut:7:a"
366AOT_theorem "oth-class-taut:7:b": (φ  (ψ χ))  ((φ & ψ)  χ)
367  by (metis "&E" "→E" "→I")
368lemmas Importation = "oth-class-taut:7:b"
369
370AOT_theorem "oth-class-taut:8:a": (φ  (ψ  χ))  (ψ  (φ  χ))
371  using "conventions:3"[THEN "df-rules-formulas[4]"] "→I" "→E" "&E" "&I" by metis
372lemmas Permutation = "oth-class-taut:8:a"
373AOT_theorem "oth-class-taut:8:b": (φ  ψ)  ((φ  χ)  (φ  (ψ & χ)))
374  by (metis "&I" "→E" "→I")
375lemmas Composition = "oth-class-taut:8:b"
376AOT_theorem "oth-class-taut:8:c": (φ  χ)  ((ψ  χ)  ((φ  ψ)  χ))
377  by (metis "∨E"(2) "→E" "→I" RAA(1))
378AOT_theorem "oth-class-taut:8:d": ((φ  ψ) & (χ  Θ))  ((φ & χ)  (ψ & Θ))
379  by (metis "&E" "&I" "→E" "→I")
380lemmas "Double Composition" = "oth-class-taut:8:d"
381AOT_theorem "oth-class-taut:8:e": ((φ & ψ)  (φ & χ))  (φ  (ψ  χ))
382  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
383            "→I" "→E" "&E" "&I")
384AOT_theorem "oth-class-taut:8:f": ((φ & ψ)  (χ & ψ))  (ψ  (φ  χ))
385  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
386            "→I" "→E" "&E" "&I")
387AOT_theorem "oth-class-taut:8:g": (ψ  χ)  ((φ  ψ)  (φ  χ))
388  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
389            "→I" "→E" "&E" "&I" "∨I" "∨E"(1))
390AOT_theorem "oth-class-taut:8:h": (ψ  χ)  ((ψ  φ)  (χ  φ))
391  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
392            "→I" "→E" "&E" "&I" "∨I" "∨E"(1))
393AOT_theorem "oth-class-taut:8:i": (φ  (ψ & χ))  (ψ  (φ  χ))
394  by (metis "conventions:3"[THEN "df-rules-formulas[4]"] "conventions:3"[THEN "df-rules-formulas[3]"]
395            "→I" "→E" "&E" "&I")
396
397AOT_theorem "intro-elim:1": assumes φ  ψ and φ  χ and ψ  Θ shows χ  Θ
398  by (metis assms "∨I"(1, 2) "∨E"(1) "conventions:3"[THEN "df-rules-formulas[3]"] "→I" "→E" "&E"(1))
399
400AOT_theorem "intro-elim:2": assumes φ  ψ and ψ  φ shows φ  ψ
401  by (meson "&I" "conventions:3" "df-rules-formulas[4]" MP assms)
402lemmas "≡I" = "intro-elim:2"
403
404AOT_theorem "intro-elim:3:a": assumes φ  ψ and φ shows ψ
405  by (metis "∨I"(1) "→I" "∨E"(1) "intro-elim:1" assms)
406AOT_theorem "intro-elim:3:b": assumes φ  ψ and ψ shows φ
407  using "intro-elim:3:a" "Commutativity of ≡" assms by blast
408AOT_theorem "intro-elim:3:c": assumes φ  ψ and ¬φ shows ¬ψ
409  using "intro-elim:3:b" "raa-cor:3" assms by blast
410AOT_theorem "intro-elim:3:d": assumes φ  ψ and ¬ψ shows ¬φ
411  using "intro-elim:3:a" "raa-cor:3" assms by blast
412AOT_theorem "intro-elim:3:e": assumes φ  ψ and ψ  χ shows φ  χ
413  by (metis "≡I" "→I" "intro-elim:3:a" "intro-elim:3:b" assms)
414declare "intro-elim:3:e"[trans]
415AOT_theorem "intro-elim:3:f": assumes φ  ψ and φ  χ shows χ  ψ
416  by (metis "≡I" "→I" "intro-elim:3:a" "intro-elim:3:b" assms)
417lemmas "≡E" = "intro-elim:3:a" "intro-elim:3:b" "intro-elim:3:c" "intro-elim:3:d" "intro-elim:3:e" "intro-elim:3:f"
418
419declare "Commutativity of ≡"[THEN "≡E"(1), sym]
420
421AOT_theorem "rule-eq-df:1": assumes φ df ψ shows φ  ψ
422  by (simp add: "≡I" "df-rules-formulas[3]" "df-rules-formulas[4]" assms)
423lemmas "≡Df" = "rule-eq-df:1"
424AOT_theorem "rule-eq-df:2": assumes φ df ψ and φ shows ψ
425  using "≡Df" "≡E"(1) assms by blast
426lemmas "≡dfE" = "rule-eq-df:2"
427AOT_theorem "rule-eq-df:3": assumes φ df ψ and ψ shows φ
428  using "≡Df" "≡E"(2) assms by blast
429lemmas "≡dfI" = "rule-eq-df:3"
430
431AOT_theorem  "df-simplify:1": assumes φ  (ψ & χ) and ψ shows φ  χ
432  by (metis "&E"(2) "&I" "≡E"(1, 2) "≡I" "→I" assms)
433(* TODO: this is a slight variation from PLM *)
434AOT_theorem  "df-simplify:2": assumes φ  (ψ & χ) and χ shows φ  ψ
435  by (metis "&E"(1) "&I" "≡E"(1, 2) "≡I" "→I" assms)
436lemmas "≡S" = "df-simplify:1"  "df-simplify:2"
437
438AOT_theorem "rule-ui:1": assumes α φ{α} and τ shows φ{τ}
439  using "→E" "cqt:1"[axiom_inst] assms by blast
440AOT_theorem "rule-ui:2[const_var]": assumes α φ{α} shows φ{β}
441  by (simp add: "rule-ui:1" "cqt:2[const_var]"[axiom_inst] assms)
442(* TODO: precise proviso in PLM *)
443AOT_theorem "rule-ui:2[lambda]":
444  assumes F φ{F} and INSTANCE_OF_CQT_2(ψ)
445  shows φ{ν1...νn ψ{ν1...νn}]}
446  by (simp add: "rule-ui:1" "cqt:2[lambda]"[axiom_inst] assms)
447AOT_theorem "rule-ui:3": assumes α φ{α} shows φ{α}
448  by (simp add: "rule-ui:2[const_var]" assms)
449lemmas "∀E" = "rule-ui:1" "rule-ui:2[const_var]" "rule-ui:2[lambda]" "rule-ui:3"
450
451AOT_theorem "cqt-orig:1[const_var]": α φ{α}  φ{β} by (simp add: "∀E"(2) "→I")
452AOT_theorem "cqt-orig:1[lambda]":
453  assumes INSTANCE_OF_CQT_2(ψ)
454  shows F φ{F}  φ{ν1...νn ψ{ν1...νn}]}
455  by (simp add: "∀E"(3) "→I" assms)
456AOT_theorem "cqt-orig:2": α (φ  ψ{α})  (φ  α ψ{α})
457  by (metis "→I" GEN "vdash-properties:6" "∀E"(4))
458AOT_theorem "cqt-orig:3": α φ{α}  φ{α} using "cqt-orig:1[const_var]" .
459
460(* TODO: work out difference to GEN *)
461AOT_theorem universal: assumes for arbitrary β: φ{β} shows α φ{α}
462  using GEN assms .
463lemmas "∀I" = universal
464
465(* Generalized mechanism for "∀I" followed by ∀E *)
466ML467fun get_instantiated_allI ctxt varname thm = let
468val trm = Thm.concl_of thm
469val trm = case trm of (@{const Trueprop} $ (@{const AOT_model_valid_in} $ _ $ x)) => x
470                      | _ => raise Term.TERM ("Expected simple theorem.", [trm])
471fun extractVars (Const (const_name‹AOT_term_of_var›, _) $ Var v) =
472    (if fst (fst v) = fst varname then [Var v] else []) (* TODO: care about the index? *)
473  | extractVars (t1 $ t2) = extractVars t1 @ extractVars t2
474  | extractVars (Abs (_, _, t)) = extractVars t
475  | extractVars _ = []
476val vars = extractVars trm
477val vars = fold Term.add_vars vars []
478val var = hd vars
479val trmty = case (snd var) of (Type (type_name‹AOT_var›, [t])) => (t)
480              | _ => raise Term.TYPE ("Expected variable type.", [snd var], [Var var])
481val trm = Abs (Term.string_of_vname (fst var), trmty, Term.abstract_over (
482      Const (const_name‹AOT_term_of_var›, Type ("fun", [snd var, trmty]))
483       $ Var var, trm))
484val trm = Thm.cterm_of (Context.proof_of ctxt) trm
485val ty = hd (Term.add_tvars (Thm.prop_of @{thm "∀I"}) [])
486val typ = Thm.ctyp_of (Context.proof_of ctxt) trmty
487val allthm = Drule.instantiate_normalize ([(ty, typ)],[]) @{thm "∀I"}
488val phi = hd (Term.add_vars (Thm.prop_of allthm) [])
489val allthm = Drule.instantiate_normalize ([],[(phi,trm)]) allthm
490in
491allthm
492end
493
494
495attribute_setup "∀I" =
496  ‹Scan.lift (Scan.repeat1 Args.var) >> (fn args => Thm.rule_attribute []
497  (fn ctxt => fn thm => fold (fn arg => fn thm => thm RS get_instantiated_allI ctxt arg thm) args thm))
498  "Quantify over a variable in a theorem using GEN."
499
500attribute_setup "unvarify" =
501  ‹Scan.lift (Scan.repeat1 Args.var) >> (fn args => Thm.rule_attribute []
502  (fn ctxt => fn thm =>
503    let
504    val thm = fold (fn arg => fn thm => thm RS get_instantiated_allI ctxt arg thm) args thm
505    val thm = fold (fn _ => fn thm => thm RS @{thm "∀E"(1)}) args thm
506    in
507     thm
508    end))
509  "Generalize a statement about variables to a statement about denoting terms."
510
511(* TODO: rereplace-lem does not apply to the embedding *)
512
513AOT_theorem "cqt-basic:1": αβ φ{α,β}  βα φ{α,β}
514  by (metis "≡I" "∀E"(2) "∀I" "→I")
515
516AOT_theorem "cqt-basic:2": α(φ{α}  ψ{α})  (α(φ{α}  ψ{α}) & α(ψ{α}  φ{α}))
517proof (rule "≡I"; rule "→I")
518  AOT_assume α(φ{α}  ψ{α})
519  AOT_hence φ{α}  ψ{α} for α using "∀E"(2) by blast
520  AOT_hence φ{α}  ψ{α} and ψ{α}  φ{α} for α
521    using "≡E"(1,2) "→I" by blast+
522  AOT_thus α(φ{α}  ψ{α}) & α(ψ{α}  φ{α})
523    by (auto intro: "&I" "∀I")
524next
525  AOT_assume α(φ{α}  ψ{α}) & α(ψ{α}  φ{α})
526  AOT_hence φ{α}  ψ{α} and ψ{α}  φ{α} for α
527    using "∀E"(2) "&E" by blast+
528  AOT_hence φ{α}  ψ{α} for α
529    using "≡I" by blast
530  AOT_thus α(φ{α}  ψ{α}) by (auto intro: "∀I")
531qed
532
533AOT_theorem "cqt-basic:3": α(φ{α}  ψ{α})  (α φ{α}  α ψ{α})
534proof(rule "→I")
535  AOT_assume α(φ{α}  ψ{α})
536  AOT_hence 1: φ{α}  ψ{α} for α using "∀E"(2) by blast
537  {
538    AOT_assume α φ{α}
539    AOT_hence α ψ{α} using 1 "∀I" "∀E"(4) "≡E" by metis
540  }
541  moreover {
542    AOT_assume α ψ{α}
543    AOT_hence α φ{α} using 1 "∀I" "∀E"(4) "≡E" by metis
544  }
545  ultimately AOT_show α φ{α}  α ψ{α}
546    using "≡I" "→I" by auto
547qed
548
549AOT_theorem "cqt-basic:4": α(φ{α} & ψ{α})  (α φ{α} & α ψ{α})
550proof(rule "→I")
551  AOT_assume 0: α(φ{α} & ψ{α})
552  AOT_have φ{α} and ψ{α} for α using "∀E"(2) 0 "&E" by blast+
553  AOT_thus α φ{α} & α ψ{α}
554    by (auto intro: "∀I" "&I")
555qed
556
557AOT_theorem "cqt-basic:5": (α1...∀αn(φ{α1...αn}))  φ{α1...αn}
558  using "cqt-orig:3" by blast
559
560AOT_theorem "cqt-basic:6": αα φ{α}  α φ{α}
561  by (meson "≡I" "→I" GEN "cqt-orig:1[const_var]")
562
563AOT_theorem "cqt-basic:7": (φ  α ψ{α})  α(φ  ψ{α})
564  by (metis "→I" "vdash-properties:6" "rule-ui:3" "≡I" GEN)
565
566AOT_theorem "cqt-basic:8": (α φ{α}  α ψ{α})  α (φ{α}  ψ{α})
567  by (simp add: "∨I"(3) "→I" GEN "cqt-orig:1[const_var]")
568
569AOT_theorem "cqt-basic:9": (α (φ{α}  ψ{α}) & α (ψ{α}  χ{α}))  α(φ{α}  χ{α})
570proof -
571  {
572    AOT_assume α (φ{α}  ψ{α})
573    moreover AOT_assume α (ψ{α}  χ{α})
574    ultimately AOT_have φ{α}  ψ{α} and ψ{α}  χ{α} for α using "∀E" by blast+
575    AOT_hence φ{α}  χ{α} for α by (metis "→E" "→I")
576    AOT_hence α(φ{α}  χ{α}) using "∀I" by fast
577  }
578  thus ?thesis using "&I" "→I" "&E" by meson
579qed
580
581AOT_theorem "cqt-basic:10": (α(φ{α}  ψ{α}) & α(ψ{α}  χ{α}))  α (φ{α}  χ{α})
582proof(rule "→I"; rule "∀I")
583  fix β
584  AOT_assume α(φ{α}  ψ{α}) & α(ψ{α}  χ{α})
585  AOT_hence φ{β}  ψ{β} and ψ{β}  χ{β} using "&E" "∀E" by blast+
586  AOT_thus φ{β}  χ{β} using "≡I" "≡E" by blast
587qed
588
589AOT_theorem "cqt-basic:11": α(φ{α}  ψ{α})  α (ψ{α}  φ{α})
590proof (rule "≡I"; rule "→I")
591  AOT_assume 0: α(φ{α}  ψ{α})
592  {
593    fix α
594    AOT_have φ{α}  ψ{α} using 0 "∀E" by blast
595    AOT_hence ψ{α}  φ{α} using "≡I" "≡E" "→I" "→E" by metis
596  }
597  AOT_thus α(ψ{α}  φ{α}) using "∀I" by fast
598next
599  AOT_assume 0: α(ψ{α}  φ{α})
600  {
601    fix α
602    AOT_have ψ{α}  φ{α} using 0 "∀E" by blast
603    AOT_hence φ{α}  ψ{α} using "≡I" "≡E" "→I" "→E" by metis
604  }
605  AOT_thus α(φ{α}  ψ{α}) using "∀I" by fast
606qed
607
608AOT_theorem "cqt-basic:12": α φ{α}  α (ψ{α}  φ{α})
609  by (simp add: "∀E"(2) "→I" GEN)
610
611AOT_theorem "cqt-basic:13": α φ{α}  β φ{β}
612  using "≡I" "→I" by blast
613
614AOT_theorem "cqt-basic:14": (α1...∀αn (φ{α1...αn}  ψ{α1...αn}))  ((α1...∀αn φ{α1...αn})  (α1...∀αn ψ{α1...αn}))
615  using "cqt:3"[axiom_inst] by auto
616
617AOT_theorem "cqt-basic:15": (α1...∀αn (φ  ψ{α1...αn}))  (φ  (α1...∀αn ψ{α1...αn}))
618  using "cqt-orig:2" by auto
619
620(* TODO: once more the same in the embedding... need to distinguish these better *)
621AOT_theorem "universal-cor": assumes for arbitrary β: φ{β}  shows α φ{α}
622  using GEN assms .
623
624AOT_theorem "existential:1": assumes φ{τ} and τ shows α φ{α}
625proof(rule "raa-cor:1")
626  AOT_assume ¬α φ{α}
627  AOT_hence α ¬φ{α}
628    using "≡dfI" "conventions:4" RAA "&I" by blast
629  AOT_hence ¬φ{τ} using assms(2) "∀E"(1) "→E" by blast
630  AOT_thus φ{τ} & ¬φ{τ} using assms(1) "&I" by blast
631qed
632
633AOT_theorem "existential:2[const_var]": assumes φ{β} shows α φ{α}
634  using "existential:1" "cqt:2[const_var]"[axiom_inst] assms by blast
635
636AOT_theorem "existential:2[lambda]":
637  assumes φ{ν1...νn ψ{ν1...νn}]} and INSTANCE_OF_CQT_2(ψ)
638  shows α φ{α}
639  using "existential:1" "cqt:2[lambda]"[axiom_inst] assms by blast
640lemmas "∃I" = "existential:1" "existential:2[const_var]" "existential:2[lambda]" 
641
642AOT_theorem "instantiation":
643  assumes for arbitrary β: φ{β}  ψ and α φ{α}
644  shows ψ
645  by (metis (no_types, lifting) "≡dfE" GEN "raa-cor:3" "conventions:4" assms)
646lemmas "∃E" = "instantiation"
647
648AOT_theorem "cqt-further:1": α φ{α}  α φ{α}
649  using "∀E"(4) "∃I"(2) "→I" by metis
650
651AOT_theorem "cqt-further:2": ¬α φ{α}  α ¬φ{α}
652  using "∀I" "∃I"(2) "→I" RAA by metis
653
654AOT_theorem "cqt-further:3": α φ{α}  ¬α ¬φ{α}
655  using "∀E"(4) "∃E" "→I" RAA
656  by (metis "cqt-further:2" "≡I" "modus-tollens:1")
657
658AOT_theorem "cqt-further:4": ¬α φ{α}  α ¬φ{α}
659  using "∀I" "∃I"(2)"→I" RAA by metis
660
661AOT_theorem "cqt-further:5": α (φ{α} & ψ{α})  (α φ{α} & α ψ{α})
662  by (metis (no_types, lifting) "&E" "&I" "∃E" "∃I"(2) "→I")
663
664AOT_theorem "cqt-further:6": α (φ{α}  ψ{α})  (α φ{α}  α ψ{α})
665  by (metis (mono_tags, lifting) "∃E" "∃I"(2) "∨E"(3) "∨I"(1, 2) "→I" RAA(2))
666
667AOT_theorem "cqt-further:7": α φ{α}  β φ{β} (* TODO: vacuous in the embedding *)
668  by (simp add: "oth-class-taut:3:a")
669
670AOT_theorem "cqt-further:8": (α φ{α} & α ψ{α})  α (φ{α}  ψ{α})
671  by (metis (mono_tags, lifting) "&E" "≡I" "∀E"(2) "→I" GEN)
672
673AOT_theorem "cqt-further:9": (¬α φ{α} & ¬α ψ{α})  α (φ{α}  ψ{α})
674  by (metis (mono_tags, lifting) "&E" "≡I" "∃I"(2) "→I" GEN "raa-cor:4")
675
676AOT_theorem "cqt-further:10": (α φ{α} & ¬α ψ{α})  ¬α (φ{α}  ψ{α})
677proof(rule "→I"; rule "raa-cor:2")
678  AOT_assume 0: α φ{α} & ¬α ψ{α}
679  then AOT_obtain α where φ{α} using "∃E" "&E"(1) by metis
680  moreover AOT_assume α (φ{α}  ψ{α})
681  ultimately AOT_have ψ{α} using "∀E"(4) "≡E"(1) by blast
682  AOT_hence α ψ{α} using "∃I" by blast
683  AOT_thus α ψ{α} & ¬α ψ{α} using 0 "&E"(2) "&I" by blast
684qed
685
686AOT_theorem "cqt-further:11": αβ φ{α,β}  βα φ{α,β}
687  using "≡I" "→I" "∃I"(2) "∃E" by metis
688
689AOT_theorem "log-prop-prop:1":  φ]
690  using "cqt:2[lambda0]"[axiom_inst] by auto
691
692AOT_theorem "log-prop-prop:2": φ
693  by (rule "≡dfI"[OF "existence:3"]) "cqt:2[lambda]"
694
695AOT_theorem "exist-nec": τ  τ
696proof -
697  AOT_have β β
698    by (simp add: GEN RN "cqt:2[const_var]"[axiom_inst])
699  AOT_thus τ  τ
700    using "cqt:1"[axiom_inst] "→E" by blast
701qed
702
703(* TODO: replace this mechanism by a "proof by types" command *)
704class AOT_Term_id = AOT_Term +
705  assumes "t=t-proper:1"[AOT]: [v  τ = τ'  τ]
706      and "t=t-proper:2"[AOT]: [v  τ = τ'  τ']
707
708instance κ :: AOT_Term_id
709proof
710  AOT_modally_strict {
711    AOT_show κ = κ'  κ for κ κ'
712    proof(rule "→I")
713      AOT_assume κ = κ'
714      AOT_hence O!κ  A!κ
715        by (rule "∨I"(3)[OF "≡dfE"[OF "identity:1"]])
716           (meson "→I" "∨I"(1) "&E"(1))+
717      AOT_thus κ
718        by (rule "∨E"(1))
719           (metis "cqt:5:a"[axiom_inst] "→I" "→E" "&E"(2))+
720    qed
721  }
722next
723  AOT_modally_strict {
724    AOT_show κ = κ'  κ' for κ κ'
725    proof(rule "→I")
726      AOT_assume κ = κ'
727      AOT_hence O!κ'  A!κ'
728        by (rule "∨I"(3)[OF "≡dfE"[OF "identity:1"]])
729           (meson "→I" "∨I" "&E")+
730      AOT_thus κ'
731        by (rule "∨E"(1))
732           (metis "cqt:5:a"[axiom_inst] "→I" "→E" "&E"(2))+
733    qed
734  }
735qed
736
737instance rel :: (AOT_κs) AOT_Term_id
738proof
739  AOT_modally_strict {
740    AOT_show Π = Π'  Π for Π Π' :: <'a> (* TODO: how to get rid of the fixes? *)
741    proof(rule "→I")
742      AOT_assume Π = Π'
743      AOT_thus Π using "≡dfE"[OF "identity:3"[of Π Π']] "&E" by blast
744    qed
745  }
746next
747  AOT_modally_strict {
748    AOT_show Π = Π'  Π' for Π Π' :: <'a> (* TODO: how to get rid of the fixes? *)
749    proof(rule "→I")
750      AOT_assume Π = Π'
751      AOT_thus Π' using "≡dfE"[OF "identity:3"[of Π Π']] "&E" by blast
752    qed
753  }
754qed
755
756instance 𝗈 :: AOT_Term_id
757proof
758  AOT_modally_strict {
759    fix φ ψ
760    AOT_show φ = ψ  φ
761    proof(rule "→I")
762      AOT_assume φ = ψ
763      AOT_thus φ using "≡dfE"[OF "identity:4"[of φ ψ]] "&E" by blast
764    qed
765  }
766next
767  AOT_modally_strict {
768    fix φ ψ
769    AOT_show φ = ψ  ψ
770    proof(rule "→I")
771      AOT_assume φ = ψ
772      AOT_thus ψ using "≡dfE"[OF "identity:4"[of φ ψ]] "&E" by blast
773    qed
774  }
775qed
776
777instance prod :: (AOT_Term_id, AOT_Term_id) AOT_Term_id
778proof
779  AOT_modally_strict {
780    fix τ τ' :: 'a×'b
781    AOT_show τ = τ'  τ
782    proof (induct τ; induct τ'; rule "→I")
783      fix τ1 τ1' :: 'a and τ2  τ2' :: 'b
784      AOT_assume «(τ1, τ2)» = «(τ1', τ2')»
785      AOT_hence (τ1 = τ1') & (τ2 = τ2') by (metis "≡dfE" tuple_identity_1)
786      AOT_hence τ1 and τ2 using "t=t-proper:1" "&E" "vdash-properties:10" by blast+
787      AOT_thus «(τ1, τ2)» by (metis "≡dfI" "&I" tuple_denotes)
788    qed
789  }
790next
791  AOT_modally_strict {
792    fix τ τ' :: 'a×'b
793    AOT_show τ = τ'  τ'
794    proof (induct τ; induct τ'; rule "→I")
795      fix τ1 τ1' :: 'a and τ2  τ2' :: 'b
796      AOT_assume «(τ1, τ2)» = «(τ1', τ2')»
797      AOT_hence (τ1 = τ1') & (τ2 = τ2') by (metis "≡dfE" tuple_identity_1)
798      AOT_hence τ1' and τ2' using "t=t-proper:2" "&E" "vdash-properties:10" by blast+
799      AOT_thus «(τ1', τ2')» by (metis "≡dfI" "&I" tuple_denotes)
800    qed
801  }
802qed
803
804(* TODO: this is the end of the "proof by types" and makes the results available on new theorems *)
805AOT_register_type_constraints
806  Term: _::AOT_Term_id› _::AOT_Term_id›
807AOT_register_type_constraints
808  Individual: ‹κ› _::{AOT_κs, AOT_Term_id}
809AOT_register_type_constraints
810  Relation: <_::{AOT_κs, AOT_Term_id}>
811
812AOT_theorem "id-rel-nec-equiv:1": Π = Π'  x1...∀xn ([Π]x1...xn  [Π']x1...xn)
813proof(rule "→I")
814  AOT_assume assumption: Π = Π'
815  AOT_hence Π and Π'
816    using "t=t-proper:1" "t=t-proper:2" MP by blast+
817  moreover AOT_have FG (F = G  ((x1...∀xn ([F]x1...xn  [F]x1...xn))  x1...∀xn ([F]x1...xn  [G]x1...xn)))
818    apply (rule GEN)+ using "l-identity"[axiom_inst] by force
819  ultimately AOT_have Π = Π'  ((x1...∀xn ([Π]x1...xn  [Π]x1...xn))  x1...∀xn ([Π]x1...xn  [Π']x1...xn))
820    using "∀E"(1) by blast
821  AOT_hence (x1...∀xn ([Π]x1...xn  [Π]x1...xn))  x1...∀xn ([Π]x1...xn  [Π']x1...xn)
822    using assumption "→E" by blast
823  moreover AOT_have x1...∀xn ([Π]x1...xn  [Π]x1...xn)
824    by (simp add: RN "oth-class-taut:3:a" "universal-cor")
825  ultimately AOT_show x1...∀xn ([Π]x1...xn  [Π']x1...xn)
826    using "→E" by blast
827qed
828
829AOT_theorem "id-rel-nec-equiv:2": φ = ψ  (φ  ψ)
830proof(rule "→I")
831  AOT_assume assumption: φ = ψ
832  AOT_hence φ and ψ
833    using "t=t-proper:1" "t=t-proper:2" MP by blast+
834  moreover AOT_have pq (p = q  (((p  p)  (p  q))))
835    apply (rule GEN)+ using "l-identity"[axiom_inst] by force
836  ultimately AOT_have φ = ψ  ((φ  φ)  (φ  ψ))
837    using "∀E"(1) by blast
838  AOT_hence (φ  φ)  (φ  ψ)
839    using assumption "→E" by blast
840  moreover AOT_have (φ  φ)
841    by (simp add: RN "oth-class-taut:3:a" "universal-cor")
842  ultimately AOT_show (φ  ψ)
843    using "→E" by blast
844qed
845
846AOT_theorem "rule=E": assumes φ{τ} and τ = σ shows φ{σ}
847proof -
848  AOT_have τ and σ using assms(2) "t=t-proper:1" "t=t-proper:2" "→E" by blast+
849  moreover AOT_have αβ(α = β  (φ{α}  φ{β}))
850    apply (rule GEN)+ using "l-identity"[axiom_inst] by blast
851  ultimately AOT_have τ = σ  (φ{τ}  φ{σ})
852    using "∀E"(1) by blast
853  AOT_thus φ{σ} using assms "→E" by blast
854qed
855
856AOT_theorem "propositions-lemma:1":  φ] = φ
857proof -
858  AOT_have φ by (simp add: "log-prop-prop:2")
859  moreover AOT_have p  p] = p using "lambda-predicates:3[zero]"[axiom_inst] "∀I" by fast
860  ultimately AOT_show  φ] = φ
861    using "∀E" by blast
862qed
863
864AOT_theorem "propositions-lemma:2":  φ]  φ
865proof -
866  AOT_have  φ]   φ] by (simp add: "oth-class-taut:3:a")
867  AOT_thus  φ]  φ using "propositions-lemma:1" "rule=E" by blast
868qed
869
870(* propositions-lemma:3 through propositions-lemma:5 do not apply *)
871
872AOT_theorem "propositions-lemma:6": (φ  ψ)  ( φ]   ψ])
873  by (metis "≡E"(1) "≡E"(5) "Associativity of ≡" "propositions-lemma:2")
874
875(* dr-alphabetic-rules does not apply *)
876
877AOT_theorem "oa-exist:1": O!
878proof -
879  AOT_have x [E!]x] by "cqt:2[lambda]"
880  AOT_hence 1: O! = x [E!]x] using "df-rules-terms[4]"[OF "oa:1", THEN "&E"(1)] "→E" by blast
881  AOT_show O! using "t=t-proper:1"[THEN "→E", OF 1] by simp
882qed
883
884AOT_theorem "oa-exist:2": A!
885proof -
886  AOT_have x ¬[E!]x] by "cqt:2[lambda]"
887  AOT_hence 1: A! = x ¬[E!]x] using "df-rules-terms[4]"[OF "oa:2", THEN "&E"(1)] "→E" by blast
888  AOT_show A! using "t=t-proper:1"[THEN "→E", OF 1] by simp
889qed
890
891AOT_theorem "oa-exist:3": O!x  A!x
892proof(rule "raa-cor:1")
893  AOT_assume ¬(O!x  A!x)
894  AOT_hence A: ¬O!x and B: ¬A!x
895    using "Disjunction Addition"(1) "modus-tollens:1" "∨I"(2) "raa-cor:5" by blast+
896  AOT_have C: O! = x [E!]x]
897    by (rule "df-rules-terms[4]"[OF "oa:1", THEN "&E"(1), THEN "→E"]) "cqt:2[lambda]"
898  AOT_have D: A! = x ¬[E!]x]
899    by (rule "df-rules-terms[4]"[OF "oa:2", THEN "&E"(1), THEN "→E"]) "cqt:2[lambda]"
900  AOT_have E: ¬x [E!]x]x
901    using A C "rule=E" by fast
902  AOT_have F: ¬x ¬[E!]x]x
903    using B D "rule=E" by fast
904  AOT_have G: x [E!]x]x  [E!]x
905    by (rule "lambda-predicates:2"[axiom_inst, THEN "→E"]) "cqt:2[lambda]"
906  AOT_have H: x ¬[E!]x]x  ¬[E!]x
907    by (rule "lambda-predicates:2"[axiom_inst, THEN "→E"]) "cqt:2[lambda]"
908  AOT_show ¬[E!]x & ¬¬[E!]x using G E "≡E" H F "≡E" "&I" by metis
909qed
910
911AOT_theorem "p-identity-thm2:1": F = G  x(x[F]  x[G])
912proof -
913  AOT_have F = G  F & G & x(x[F]  x[G])
914    using "identity:2" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
915  moreover AOT_have F and G
916    by (auto simp: "cqt:2[const_var]"[axiom_inst])
917  ultimately AOT_show F = G  x(x[F]  x[G])
918    using "≡S"(1) "&I" by blast
919qed
920
921AOT_theorem "p-identity-thm2:2[2]": F = G  y1(x [F]xy1] = x [G]xy1] & x [F]y1x] = x [G]y1x])
922proof -
923  AOT_have F = G  F & G & y1(x [F]xy1] = x [G]xy1] & x [F]y1x] = x [G]y1x])
924    using "identity:3[2]" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
925  moreover AOT_have F and G
926    by (auto simp: "cqt:2[const_var]"[axiom_inst])
927  ultimately show ?thesis
928    using "≡S"(1) "&I" by blast
929qed
930    
931AOT_theorem "p-identity-thm2:2[3]": F = G  y1y2(x [F]xy1y2] = x [G]xy1y2] & x [F]y1xy2] = x [G]y1xy2] & x [F]y1y2x] = x [G]y1y2x])
932proof -
933  AOT_have F = G  F & G & y1y2(x [F]xy1y2] = x [G]xy1y2] & x [F]y1xy2] = x [G]y1xy2] & x [F]y1y2x] = x [G]y1y2x])
934    using "identity:3[3]" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
935  moreover AOT_have F and G
936    by (auto simp: "cqt:2[const_var]"[axiom_inst])
937  ultimately show ?thesis
938    using "≡S"(1) "&I" by blast
939qed
940
941AOT_theorem "p-identity-thm2:2[4]": F = G  y1y2y3(x [F]xy1y2y3] = x [G]xy1y2y3] & x [F]y1xy2y3] = x [G]y1xy2y3] & x [F]y1y2xy3] = x [G]y1y2xy3] & x [F]y1y2y3x] = x [G]y1y2y3x])
942proof -
943  AOT_have F = G  F & G & y1y2y3(x [F]xy1y2y3] = x [G]xy1y2y3] & x [F]y1xy2y3] = x [G]y1xy2y3] & x [F]y1y2xy3] = x [G]y1y2xy3] & x [F]y1y2y3x] = x [G]y1y2y3x])
944    using "identity:3[4]" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
945  moreover AOT_have F and G
946    by (auto simp: "cqt:2[const_var]"[axiom_inst])
947  ultimately show ?thesis
948    using "≡S"(1) "&I" by blast
949qed
950
951AOT_theorem "p-identity-thm2:2":
952  F = G  x1...∀xn «AOT_sem_proj_id x1xn (λ τ . «[F]τ») (λ τ . «[G]τ»)»
953proof -
954  AOT_have F = G  F & G & x1...∀xn «AOT_sem_proj_id x1xn (λ τ . «[F]τ») (λ τ . «[G]τ»)»
955    using "identity:3" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
956  moreover AOT_have F and G
957    by (auto simp: "cqt:2[const_var]"[axiom_inst])
958  ultimately show ?thesis
959    using "≡S"(1) "&I" by blast
960qed
961
962AOT_theorem "p-identity-thm2:3":
963  p = q  x p] = x q]
964proof -
965  AOT_have p = q  p & q & x p] = x q]
966    using "identity:4" "df-rules-formulas[3]" "df-rules-formulas[4]" "→E" "&E" "≡I" "→I" by blast
967  moreover AOT_have p and q
968    by (auto simp: "cqt:2[const_var]"[axiom_inst])
969  ultimately show ?thesis
970    using "≡S"(1) "&I" by blast
971qed
972
973class AOT_Term_id_2 = AOT_Term_id + assumes "id-eq:1": [v  α = α]
974
975instance κ :: AOT_Term_id_2
976proof
977  AOT_modally_strict {
978    fix x
979    {
980      AOT_assume O!x
981      moreover AOT_have F([F]x  [F]x)
982        using RN GEN "oth-class-taut:3:a" by fast
983      ultimately AOT_have O!x & O!x & F([F]x  [F]x) using "&I" by simp
984    }
985    moreover {
986      AOT_assume A!x
987      moreover AOT_have F(x[F]  x[F])
988        using RN GEN "oth-class-taut:3:a" by fast
989      ultimately AOT_have A!x & A!x & F(x[F]  x[F]) using "&I" by simp
990    }
991    ultimately AOT_have (O!x & O!x & F([F]x  [F]x))  (A!x & A!x & F(x[F]  x[F]))
992      using "oa-exist:3" "∨I"(1) "∨I"(2) "∨E"(3) "raa-cor:1" by blast
993    AOT_thus x = x
994      using "identity:1"[THEN "df-rules-formulas[4]"] "→E" by blast
995  }
996qed
997
998instance rel :: ("{AOT_κs,AOT_Term_id_2}") AOT_Term_id_2
999proof
1000  AOT_modally_strict {
1001    fix F :: "<'a> AOT_var"
1002    AOT_have 0: x1...xn [F]x1...xn] = F
1003      by (simp add: "lambda-predicates:3"[axiom_inst])
1004    AOT_have x1...xn [F]x1...xn]
1005      by "cqt:2[lambda]"
1006    AOT_hence x1...xn [F]x1...xn] = x1...xn [F]x1...xn]
1007      using "lambda-predicates:1"[axiom_inst] "→E" by blast
1008    AOT_show F = F using "rule=E" 0 by force 
1009  }
1010qed
1011
1012instance 𝗈 :: AOT_Term_id_2
1013proof
1014  AOT_modally_strict {
1015    fix p
1016    AOT_have 0:  p] = p
1017      by (simp add: "lambda-predicates:3[zero]"[axiom_inst])
1018    AOT_have  p]
1019      by (rule "cqt:2[lambda0]"[axiom_inst])
1020    AOT_hence  p] =  p]
1021      using "lambda-predicates:1[zero]"[axiom_inst] "→E" by blast
1022    AOT_show p = p using "rule=E" 0 by force
1023  }
1024qed
1025
1026instance prod :: (AOT_Term_id_2, AOT_Term_id_2) AOT_Term_id_2
1027proof
1028  AOT_modally_strict {
1029    fix α :: ('a×'b) AOT_var›
1030    AOT_show α = α
1031    proof (induct)
1032      AOT_show τ = τ if τ for τ :: 'a×'b
1033        using that
1034      proof (induct τ)
1035        fix τ1 :: 'a and τ2 :: 'b
1036        AOT_assume «(τ1,τ2)»
1037        AOT_hence τ1 and τ2 using "≡dfE" "&E" tuple_denotes by blast+
1038        AOT_hence τ1 = τ1 and τ2 = τ2 using "id-eq:1"[unvarify α] by blast+
1039        AOT_thus «(τ1, τ2)» = «(τ1, τ2)» by (metis "≡dfI" "&I" tuple_identity_1)
1040      qed
1041    qed
1042  }
1043qed
1044
1045AOT_register_type_constraints
1046  Term: _::AOT_Term_id_2› _::AOT_Term_id_2›
1047AOT_register_type_constraints
1048  Individual: ‹κ› _::{AOT_κs, AOT_Term_id_2}
1049AOT_register_type_constraints
1050  Relation: <_::{AOT_κs, AOT_Term_id_2}>
1051
1052(* TODO: Interestingly, this doesn't depend on "id-eq:1" at all! *)
1053AOT_theorem "id-eq:2": α = β  β = α
1054(*
1055  TODO: look at this proof generated using:
1056        including AOT_no_atp sledgehammer[isar_proofs = true]
1057proof -
1058  have "(∃φ. [v ⊨ ~β = α → ~φ] ∧ [v ⊨ α = β → φ]) ∨ (∃φ. ¬ [v ⊨ φ{α} → φ{β}])"
1059    by meson
1060  then show ?thesis
1061    by (meson "contraposition:2" "Hypothetical Syllogism" "deduction-theorem" l_"identity:1" "useful-tautologies:1")
1062qed
1063*)
1064(*  by (meson "rule=E" "deduction-theorem") *)
1065proof (rule "→I")
1066  AOT_assume α = β
1067  moreover AOT_have β = β using calculation "rule=E"[of _ "λ τ . «τ = β»" "AOT_term_of_var α" "AOT_term_of_var β"] by blast
1068  moreover AOT_have α = α  α = α using "if-p-then-p" by blast
1069  ultimately AOT_show β = α
1070    using "→E" "→I" "rule=E"[of _ "λ τ . «(τ = τ)  (τ = α)»" "AOT_term_of_var α" "AOT_term_of_var β"] by blast
1071qed
1072
1073AOT_theorem "id-eq:3": α = β & β = γ  α = γ
1074  using "rule=E" "→I" "&E" by blast
1075
1076AOT_theorem "id-eq:4": α = β  γ (α = γ  β = γ)
1077proof (rule "≡I"; rule "→I")
1078  AOT_assume 0: α = β
1079  AOT_hence 1: β = α using "id-eq:2" "→E" by blast
1080  AOT_show γ (α = γ  β = γ)
1081    by (rule GEN) (metis "≡I" "→I" 0 "1" "rule=E")
1082next
1083  AOT_assume γ (α = γ  β = γ)
1084  AOT_hence α = α  β = α using "∀E"(2) by blast
1085  AOT_hence α = α  β = α using "≡E"(1) "→I" by blast
1086  AOT_hence β = α using "id-eq:1" "→E" by blast
1087  AOT_thus α = β using "id-eq:2" "→E" by blast
1088qed
1089
1090AOT_theorem "rule=I:1": assumes τ shows τ = τ
1091proof -
1092  AOT_have α (α = α)
1093    by (rule GEN) (metis "id-eq:1")
1094  AOT_thus τ = τ using assms "∀E" by blast
1095qed
1096
1097AOT_theorem "rule=I:2[const_var]": "α = α"
1098  using "id-eq:1".
1099
1100AOT_theorem "rule=I:2[lambda]": assumes INSTANCE_OF_CQT_2(φ) shows "ν1...νn φ{ν1...νn}] = ν1...νn φ{ν1...νn}]"
1101proof -
1102  AOT_have α (α = α)
1103    by (rule GEN) (metis "id-eq:1")
1104  moreover AOT_have ν1...νn φ{ν1...νn}] using assms by (rule "cqt:2[lambda]"[axiom_inst])
1105  ultimately AOT_show ν1...νn φ{ν1...νn}] = ν1...νn φ{ν1...νn}] using assms "∀E" by blast
1106qed
1107
1108lemmas "=I" = "rule=I:1" "rule=I:2[const_var]" "rule=I:2[lambda]"
1109
1110AOT_theorem "rule-id-df:1":
1111  assumes τ{α1...αn} =df σ{α1...αn} and σ{τ1...τn}
1112  shows τ{τ1...τn} = σ{τ1...τn}
1113proof -
1114  AOT_have σ{τ1...τn}  τ{τ1...τn} = σ{τ1...τn}
1115    using "df-rules-terms[3]" assms(1) "&E" by blast
1116  AOT_thus τ{τ1...τn} = σ{τ1...τn}
1117    using assms(2) "→E" by blast
1118qed
1119
1120AOT_theorem "rule-id-df:1[zero]":
1121  assumes τ =df σ and σ
1122  shows τ = σ
1123proof -
1124  AOT_have σ  τ = σ
1125    using "df-rules-terms[4]" assms(1) "&E" by blast
1126  AOT_thus τ = σ
1127    using assms(2) "→E" by blast
1128qed
1129
1130AOT_theorem "rule-id-df:2:a":
1131  assumes τ{α1...αn} =df σ{α1...αn} and σ{τ1...τn} and φ{τ{τ1...τn}}
1132  shows φ{σ{τ1...τn}}
1133proof -
1134  AOT_have τ{τ1...τn} = σ{τ1...τn} using "rule-id-df:1" assms(1,2) by blast
1135  AOT_thus φ{σ{τ1...τn}} using assms(3) "rule=E" by blast
1136qed
1137
1138(* TODO: get rid of this, ideally *)
1139AOT_theorem "rule-id-df:2:a[2]":
1140  assumes τ{«(α1,α2)»} =df σ{«(α1,α2)»} and σ{«(τ1,τ2)»} and φ{τ{«(τ1,τ2)»}}
1141  shows φ{σ{«(τ1,τ2)»}}
1142proof -
1143  AOT_have τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1144  proof -
1145    AOT_have σ{«(τ1,τ2)»}  τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1146      using assms by (simp add: AOT_sem_conj AOT_sem_imp AOT_sem_eq AOT_sem_not AOT_sem_denotes AOT_model_id_def) (* NOTE: semantics needed *)
1147    AOT_thus τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1148      using assms(2) "→E" by blast
1149  qed
1150  AOT_thus φ{σ{«(τ1,τ2)»}} using assms(3) "rule=E" by blast
1151qed
1152
1153AOT_theorem "rule-id-df:2:a[zero]":
1154  assumes τ =df σ and σ and φ{τ}
1155  shows φ{σ}
1156proof -
1157  AOT_have τ = σ using "rule-id-df:1[zero]" assms(1,2) by blast
1158  AOT_thus φ{σ} using assms(3) "rule=E" by blast
1159qed
1160
1161lemmas "=dfE" = "rule-id-df:2:a" "rule-id-df:2:a[zero]"
1162
1163AOT_theorem "rule-id-df:2:b":
1164  assumes τ{α1...αn} =df σ{α1...αn} and σ{τ1...τn} and φ{σ{τ1...τn}}
1165  shows φ{τ{τ1...τn}}
1166proof -
1167  AOT_have τ{τ1...τn} = σ{τ1...τn} using "rule-id-df:1" assms(1,2) by blast
1168  AOT_hence σ{τ1...τn} = τ{τ1...τn}
1169    using "rule=E" "=I"(1) "t=t-proper:1" "→E" by fast
1170  AOT_thus φ{τ{τ1...τn}} using assms(3) "rule=E" by blast
1171qed
1172
1173(* TODO: get rid of this, ideally *)
1174AOT_theorem "rule-id-df:2:b[2]":
1175  assumes τ{«(α1,α2)»} =df σ{«(α1,α2)»} and σ{«(τ1,τ2)»} and φ{σ{«(τ1,τ2)»}}
1176  shows φ{τ{«(τ1,τ2)»}}
1177proof -
1178  AOT_have τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1179  proof -
1180    AOT_have σ{«(τ1,τ2)»}  τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1181      using assms by (simp add: AOT_sem_conj AOT_sem_imp AOT_sem_eq AOT_sem_not AOT_sem_denotes AOT_model_id_def) (* NOTE: semantics needed *)
1182    AOT_thus τ{«(τ1,τ2)»} = σ{«(τ1,τ2)»}
1183      using assms(2) "→E" by blast
1184  qed
1185  AOT_hence σ{«(τ1,τ2)»} = τ{«(τ1,τ2)»}
1186    using "rule=E" "=I"(1) "t=t-proper:1" "→E" by fast
1187  AOT_thus φ{τ{«(τ1,τ2)»}} using assms(3) "rule=E" by blast
1188qed
1189
1190AOT_theorem "rule-id-df:2:b[zero]":
1191  assumes τ =df σ and σ and φ{σ}
1192  shows φ{τ}
1193proof -
1194  AOT_have τ = σ using "rule-id-df:1[zero]" assms(1,2) by blast
1195  AOT_hence σ = τ
1196    using "rule=E" "=I"(1) "t=t-proper:1" "→E" by fast
1197  AOT_thus φ{τ} using assms(3) "rule=E" by blast
1198qed
1199
1200lemmas "=dfI" = "rule-id-df:2:b" "rule-id-df:2:b[zero]"
1201
1202AOT_theorem "free-thms:1": τ  β (β = τ)
1203  by (metis "∃E" "rule=I:1" "t=t-proper:2" "→I" "∃I"(1) "≡I" "→E")
1204
1205AOT_theorem "free-thms:2": α φ{α}  (β (β = τ)  φ{τ})
1206  by (metis "∃E" "rule=E" "cqt:2[const_var]"[axiom_inst] "→I" "∀E"(1))
1207
1208AOT_theorem "free-thms:3[const_var]": β (β = α)
1209  by (meson "∃I"(2) "id-eq:1")
1210
1211AOT_theorem "free-thms:3[lambda]": assumes INSTANCE_OF_CQT_2(φ) shows β (β = ν1...νn φ{ν1...νn}])
1212  by (meson "=I"(3) assms "cqt:2[lambda]"[axiom_inst] "existential:1")
1213
1214AOT_theorem "free-thms:4[rel]": ([Π]κ1...κn  κ1...κn[Π])  β (β = Π)
1215  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a"[axiom_inst] "cqt:5:b"[axiom_inst] "→I" "∃I"(1))
1216
1217(* TODO: this is a rather weird way to formulate this and we don't have tuple-existential-elimination
1218         or tuple-equality-elimination in the theory... Splitting them is also a bit unfortunate, though.*)
1219AOT_theorem "free-thms:4[vars]": ([Π]κ1...κn  κ1...κn[Π])  β1...∃βn (β1...βn = κ1...κn)
1220  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a"[axiom_inst] "cqt:5:b"[axiom_inst] "→I" "∃I"(1))
1221
1222AOT_theorem "free-thms:4[1,rel]": ([Π]κ  κ[Π])  β (β = Π)
1223  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a"[axiom_inst] "cqt:5:b"[axiom_inst] "→I" "∃I"(1))
1224AOT_theorem "free-thms:4[1,1]": ([Π]κ  κ[Π])  β (β = κ)
1225  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a"[axiom_inst] "cqt:5:b"[axiom_inst] "→I" "∃I"(1))
1226
1227AOT_theorem "free-thms:4[2,rel]": ([Π]κ1κ2  κ1κ2[Π])  β (β = Π)
1228  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a[2]"[axiom_inst] "cqt:5:b[2]"[axiom_inst] "→I" "∃I"(1))
1229AOT_theorem "free-thms:4[2,1]": ([Π]κ1κ2  κ1κ2[Π])  β (β = κ1)
1230  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[2]"[axiom_inst] "cqt:5:b[2]"[axiom_inst] "→I" "∃I"(1))
1231AOT_theorem "free-thms:4[2,2]": ([Π]κ1κ2  κ1κ2[Π])  β (β = κ2)
1232  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a[2]"[axiom_inst] "cqt:5:b[2]"[axiom_inst] "→I" "∃I"(1))
1233AOT_theorem "free-thms:4[3,rel]": ([Π]κ1κ2κ3  κ1κ2κ3[Π])  β (β = Π)
1234  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a[3]"[axiom_inst] "cqt:5:b[3]"[axiom_inst] "→I" "∃I"(1))
1235AOT_theorem "free-thms:4[3,1]": ([Π]κ1κ2κ3  κ1κ2κ3[Π])  β (β = κ1)
1236  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[3]"[axiom_inst] "cqt:5:b[3]"[axiom_inst] "→I" "∃I"(1))
1237AOT_theorem "free-thms:4[3,2]": ([Π]κ1κ2κ3  κ1κ2κ3[Π])  β (β = κ2)
1238  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[3]"[axiom_inst] "cqt:5:b[3]"[axiom_inst] "→I" "∃I"(1))
1239AOT_theorem "free-thms:4[3,3]": ([Π]κ1κ2κ3  κ1κ2κ3[Π])  β (β = κ3)
1240  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a[3]"[axiom_inst] "cqt:5:b[3]"[axiom_inst] "→I" "∃I"(1))
1241AOT_theorem "free-thms:4[4,rel]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = Π)
1242  by (metis "rule=I:1" "&E"(1) "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1243AOT_theorem "free-thms:4[4,1]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = κ1)
1244  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1245AOT_theorem "free-thms:4[4,2]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = κ2)
1246  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1247AOT_theorem "free-thms:4[4,3]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = κ3)
1248  by (metis "rule=I:1" "&E" "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1249AOT_theorem "free-thms:4[4,4]": ([Π]κ1κ2κ3κ4  κ1κ2κ3κ4[Π])  β (β = κ4)
1250  by (metis "rule=I:1" "&E"(2) "∨E"(1) "cqt:5:a[4]"[axiom_inst] "cqt:5:b[4]"[axiom_inst] "→I" "∃I"(1))
1251
1252AOT_theorem "ex:1:a": α α
1253  by (rule GEN) (fact "cqt:2[const_var]"[axiom_inst])
1254AOT_theorem "ex:1:b": αβ(β = α)
1255  by (rule GEN) (fact "free-thms:3[const_var]")
1256
1257AOT_theorem "ex:2:a": α
1258  by (rule RN) (fact "cqt:2[const_var]"[axiom_inst])
1259AOT_theorem "ex:2:b": β(β = α)
1260  by (rule RN) (fact "free-thms:3[const_var]")
1261
1262AOT_theorem "ex:3:a": α α
1263  by (rule RN) (fact "ex:1:a")
1264AOT_theorem "ex:3:b": αβ(β = α)
1265  by (rule RN) (fact "ex:1:b")
1266
1267AOT_theorem "ex:4:a": α α
1268  by (rule GEN; rule RN) (fact "cqt:2[const_var]"[axiom_inst])
1269AOT_theorem "ex:4:b": αβ(β = α)
1270  by (rule GEN; rule RN) (fact "free-thms:3[const_var]")
1271
1272AOT_theorem "ex:5:a": α α
1273  by (rule RN) (simp add: "ex:4:a")
1274AOT_theorem "ex:5:b": αβ(β = α)
1275  by (rule RN) (simp add: "ex:4:b")
1276
1277AOT_theorem "all-self=:1": α(α = α)
1278  by (rule RN; rule GEN) (fact "id-eq:1")
1279AOT_theorem "all-self=:2": α(α = α)
1280  by (rule GEN; rule RN) (fact "id-eq:1")
1281
1282AOT_theorem "id-nec:1": α = β  (α = β)
1283proof(rule "→I")
1284  AOT_assume α = β
1285  moreover AOT_have (α = α)
1286    by (rule RN) (fact "id-eq:1")
1287  ultimately AOT_show (α = β) using "rule=E" by fast
1288qed
1289
1290AOT_theorem "id-nec:2": τ = σ  (τ = σ)
1291proof(rule "→I")
1292  AOT_assume asm: τ = σ
1293  moreover AOT_have τ
1294    using calculation "t=t-proper:1" "→E" by blast
1295  moreover AOT_have (τ = τ)
1296    using calculation "all-self=:2" "∀E"(1) by blast
1297  ultimately AOT_show (τ = σ) using "rule=E" by fast
1298qed
1299
1300AOT_theorem "term-out:1": φ{α}  β (β = α & φ{β})
1301proof (rule "≡I"; rule "→I")
1302  AOT_assume asm: φ{α}
1303  AOT_show β (β = α & φ{β})
1304    by (rule "∃I"(2)[where β=α]; rule "&I")
1305       (auto simp: "id-eq:1" asm)
1306next
1307  AOT_assume 0: β (β = α & φ{β})
1308  (* TODO: have another look at this instantiation. Ideally AOT_obtain would resolve directly to the existential
1309           statement as proof obligation *)
1310  AOT_obtain β where β = α & φ{β} using "instantiation"[rotated, OF 0] by blast
1311  AOT_thus φ{α} using "&E" "rule=E" by blast
1312qed
1313
1314AOT_theorem "term-out:2": τ  (φ{τ}  α(α = τ & φ{α}))
1315proof(rule "→I")
1316  AOT_assume τ
1317  moreover AOT_have α (φ{α}  β (β = α & φ{β}))
1318    by (rule GEN) (fact "term-out:1")
1319  ultimately AOT_show φ{τ}  α(α = τ & φ{α})
1320    using "∀E" by blast
1321qed
1322
1323(* TODO: example of an apply-style proof. Keep or reformulate? *)
1324AOT_theorem "term-out:3": (φ{α} & β(φ{β}  β = α))  β(φ{β}  β = α)
1325  apply (rule "≡I"; rule "→I")
1326   apply (frule "&E"(1)) apply (drule "&E"(2))
1327   apply (rule GEN; rule "≡I"; rule "→I")
1328  using "rule-ui:2[const_var]" "vdash-properties:5" apply blast
1329  apply (meson "rule=E" "id-eq:1")
1330  apply (rule "&I")
1331  using "id-eq:1" "≡E"(2) "rule-ui:3" apply blast
1332  apply (rule GEN; rule "→I")
1333  using "≡E"(1) "rule-ui:2[const_var]" by blast
1334
1335AOT_theorem "term-out:4": (φ{β} & α(φ{α}  α = β))  α(φ{α}  α = β)
1336  using "term-out:3" . (* TODO: same as above - another instance of the generalized alphabetic variant rule... *)
1337
1338(* TODO: would of course be nice to define it without the syntax magic *)
1339AOT_define AOT_exists_unique :: ‹α  φ  φ›
1340  "uniqueness:1": «AOT_exists_unique φ» df α (φ{α} & β (φ{β}  β = α))
1341syntax "_AOT_exists_unique" :: ‹α  φ  φ› ("∃!_ _" [1,40])
1342AOT_syntax_print_translations
1343  "_AOT_exists_unique τ φ" <= "CONST AOT_exists_unique (_abs τ φ)"
1344syntax
1345   "_AOT_exists_unique_ellipse" :: ‹id_position  id_position  φ  φ› (∃!_...∃!_ _› [1,40])
1346parse_ast_translation[(syntax_const‹_AOT_exists_unique_ellipse›, fn ctx => fn [a,b,c] =>
1347  Ast.mk_appl (Ast.Constant "AOT_exists_unique") [parseEllipseList "_AOT_vars" ctx [a,b],c]),
1348(syntax_const‹_AOT_exists_unique›,AOT_restricted_binder const_name‹AOT_exists_unique› const_syntax‹AOT_conj›)]
1349print_translationAOT_syntax_print_translations
1350  [AOT_preserve_binder_abs_tr' const_syntax‹AOT_exists_unique› syntax_const‹_AOT_exists_unique› (syntax_const‹_AOT_exists_unique_ellipse›, true) const_name‹AOT_conj›,
1351  AOT_binder_trans @{theory} @{binding "AOT_exists_unique_binder"} syntax_const‹_AOT_exists_unique›]
1352
1353
1354
1355context AOT_meta_syntax
1356begin
1357notation AOT_exists_unique (binder "!" 20)
1358end
1359context AOT_no_meta_syntax
1360begin
1361no_notation AOT_exists_unique (binder "!" 20)
1362end
1363
1364AOT_theorem "uniqueness:2": ∃!α φ{α}  αβ(φ{β}  β = α)
1365proof(rule "≡I"; rule "→I")
1366    AOT_assume ∃!α φ{α}
1367    AOT_hence α (φ{α} & β (φ{β}  β = α))
1368      using "uniqueness:1" "≡dfE" by blast
1369    then AOT_obtain α where φ{α} & β (φ{β}  β = α) using "instantiation"[rotated] by blast
1370    AOT_hence β(φ{β}  β = α) using "term-out:3" "≡E" by blast
1371    AOT_thus αβ(φ{β}  β = α)
1372      using "∃I" by fast
1373next
1374    AOT_assume αβ(φ{β}  β = α)
1375    then AOT_obtain α where β (φ{β}  β = α) using "instantiation"[rotated] by blast
1376    AOT_hence φ{α} & β (φ{β}  β = α) using "term-out:3" "≡E" by blast
1377    AOT_hence α (φ{α} & β (φ{β}  β = α))
1378      using "∃I" by fast
1379    AOT_thus ∃!α φ{α}
1380      using "uniqueness:1" "≡dfI" by blast
1381qed
1382
1383AOT_theorem "uni-most": ∃!α φ{α}  βγ((φ{β} & φ{γ})  β = γ)
1384proof(rule "→I"; rule GEN; rule GEN; rule "→I")
1385  fix β γ
1386  AOT_assume ∃!α φ{α}
1387  AOT_hence αβ(φ{β}  β = α)
1388    using "uniqueness:2" "≡E" by blast
1389  then AOT_obtain α where β(φ{β}  β = α)
1390    using "instantiation"[rotated] by blast
1391  moreover AOT_assume φ{β} & φ{γ}
1392  ultimately AOT_have β = α and γ = α
1393    using "∀E"(2) "&E" "≡E"(1,2) by blast+
1394  AOT_thus β = γ
1395    by (metis "rule=E" "id-eq:2" "→E")
1396qed
1397
1398AOT_theorem "nec-exist-!": α(φ{α}  φ{α})  (∃!α φ{α}  ∃!α φ{α})
1399proof (rule "→I"; rule "→I")
1400  AOT_assume a: α(φ{α}  φ{α})
1401  AOT_assume ∃!α φ{α}
1402  AOT_hence α (φ{α} & β (φ{β}  β = α)) using "uniqueness:1" "≡dfE" by blast
1403  then AOT_obtain α where ξ: φ{α} & β (φ{β}  β = α) using "instantiation"[rotated] by blast
1404  AOT_have φ{α}
1405    using ξ a "&E" "∀E" "→E" by fast
1406  moreover AOT_have β (φ{β}  β = α)
1407    apply (rule GEN; rule "→I")
1408    using ξ[THEN "&E"(2), THEN "∀E"(2), THEN "→E"] "qml:2"[axiom_inst, THEN "→E"] by blast
1409  ultimately AOT_have (φ{α} & β (φ{β}  β = α))
1410    using "&I" by blast
1411  AOT_thus ∃!α φ{α}
1412    using "uniqueness:1" "≡dfI" "∃I" by fast
1413qed
1414
1415AOT_theorem "act-cond": 𝒜(φ  ψ)  (𝒜φ  𝒜ψ)
1416  using "→I" "≡E"(1) "logic-actual-nec:2"[axiom_inst] by blast
1417
1418AOT_theorem "nec-imp-act": φ  𝒜φ
1419  by (metis "act-cond" "contraposition:1[2]" "≡E"(4) "qml:2"[THEN act_closure, axiom_inst] "qml-act:2"[axiom_inst] RAA(1) "→E" "→I")
1420
1421AOT_theorem "act-conj-act:1": 𝒜(𝒜φ  φ)
1422  using "→I" "≡E"(2) "logic-actual-nec:2"[axiom_inst] "logic-actual-nec:4"[axiom_inst] by blast
1423
1424AOT_theorem "act-conj-act:2": 𝒜(φ  𝒜φ)
1425  by (metis "→I" "≡E"(2, 4) "logic-actual-nec:2"[axiom_inst] "logic-actual-nec:4"[axiom_inst] RAA(1))
1426
1427AOT_theorem "act-conj-act:3": (𝒜φ & 𝒜ψ)  𝒜(φ & ψ)
1428proof -
1429  AOT_have (φ  (ψ  (φ & ψ)))
1430    by (rule RN) (fact Adjunction)
1431  AOT_hence 𝒜(φ  (ψ  (φ & ψ)))
1432    using "nec-imp-act" "→E" by blast
1433  AOT_hence 𝒜φ  𝒜(ψ  (φ & ψ))
1434    using "act-cond" "→E" by blast
1435  moreover AOT_have 𝒜(ψ  (φ & ψ))  (𝒜ψ  𝒜(φ & ψ))
1436    by (fact "act-cond")
1437  ultimately AOT_have 𝒜φ  (𝒜ψ  𝒜(φ & ψ))
1438    using "→I" "→E" by metis
1439  AOT_thus (𝒜φ & 𝒜ψ)  𝒜(φ & ψ)
1440    by (metis Importation "→E")
1441qed
1442
1443AOT_theorem "act-conj-act:4": 𝒜(𝒜φ  φ)
1444proof -
1445  AOT_have (𝒜(𝒜φ  φ) & 𝒜(φ  𝒜φ))  𝒜((𝒜φ  φ) & (φ  𝒜φ))
1446    by (fact "act-conj-act:3")
1447  moreover AOT_have 𝒜(𝒜φ  φ) & 𝒜(φ  𝒜φ)
1448    using "&I" "act-conj-act:1" "act-conj-act:2" by simp
1449  ultimately AOT_have ζ: 𝒜((𝒜φ  φ) & (φ  𝒜φ))
1450    using "→E" by blast
1451  AOT_have 𝒜(((𝒜φ  φ) & (φ  𝒜φ))  (𝒜φ  φ))
1452    using "conventions:3"[THEN "df-rules-formulas[2]", THEN act_closure, axiom_inst] by blast
1453  AOT_hence 𝒜((𝒜φ  φ) & (φ  𝒜φ))  𝒜(𝒜φ  φ)
1454    using "act-cond" "→E" by blast
1455  AOT_thus 𝒜(𝒜φ  φ) using ζ "→E" by blast
1456qed
1457
1458(* TODO: consider introducing AOT_inductive *)
1459inductive arbitrary_actualization for φ where
1460  arbitrary_actualization φ «𝒜φ»
1461| arbitrary_actualization φ «𝒜ψ» if arbitrary_actualization φ ψ
1462declare arbitrary_actualization.cases[AOT] arbitrary_actualization.induct[AOT]
1463        arbitrary_actualization.simps[AOT] arbitrary_actualization.intros[AOT]
1464syntax arbitrary_actualization :: ‹φ'  φ'  AOT_prop› ("ARBITRARY'_ACTUALIZATION'(_,_')")
1465
1466notepad
1467begin
1468  AOT_modally_strict {
1469    fix φ
1470    AOT_have ARBITRARY_ACTUALIZATION(𝒜φ  φ, 𝒜(𝒜φ  φ))
1471      using AOT_PLM.arbitrary_actualization.intros by metis
1472    AOT_have ARBITRARY_ACTUALIZATION(𝒜φ  φ, 𝒜𝒜(𝒜φ  φ))
1473      using AOT_PLM.arbitrary_actualization.intros by metis
1474    AOT_have ARBITRARY_ACTUALIZATION(𝒜φ  φ, 𝒜𝒜𝒜(𝒜φ  φ))
1475      using AOT_PLM.arbitrary_actualization.intros by metis
1476  }
1477end
1478
1479
1480AOT_theorem "closure-act:1": assumes ARBITRARY_ACTUALIZATION(𝒜φ  φ, ψ) shows ψ
1481using assms proof(induct)
1482  case 1
1483  AOT_show 𝒜(𝒜φ  φ)
1484    by (simp add: "act-conj-act:4")
1485next
1486  case (2 ψ)
1487  AOT_thus 𝒜ψ
1488    by (metis arbitrary_actualization.simps "≡E"(1) "logic-actual-nec:4"[axiom_inst])
1489qed
1490
1491AOT_theorem "closure-act:2": α 𝒜(𝒜φ{α}  φ{α})
1492  by (simp add: "act-conj-act:4" "∀I")
1493
1494AOT_theorem "closure-act:3": 𝒜α 𝒜(𝒜φ{α}  φ{α})
1495  by (metis (no_types, lifting) "act-conj-act:4" "≡E"(1,2) "logic-actual-nec:3"[axiom_inst] "logic-actual-nec:4"[axiom_inst] "∀I")
1496
1497AOT_theorem "closure-act:4": 𝒜α1...∀αn 𝒜(𝒜φ{α1...αn}  φ{α1...αn})
1498  using "closure-act:3" .
1499
1500(* TODO: examine these proofs *)
1501AOT_theorem "RA[1]": assumes  φ shows  𝒜φ
1502  (* This proof is the one rejected in remark (136) (meta-rule) *)
1503  using "¬¬E" assms "≡E"(3) "logic-actual"[act_axiom_inst] "logic-actual-nec:1"[axiom_inst] "modus-tollens:2" by blast
1504AOT_theorem "RA[2]": assumes  φ shows 𝒜φ
1505  (* This is actually Γ ⊢ φ ⟹ □Γ ⊢ 𝒜φ*)
1506  using RN assms "nec-imp-act" "vdash-properties:5" by blast
1507AOT_theorem "RA[3]": assumes Γ  φ shows 𝒜Γ  𝒜φ
1508  using assms by (meson AOT_sem_act imageI)
1509  (* This is not exactly right either. *)
1510
1511AOT_act_theorem "ANeg:1": ¬𝒜φ  ¬φ
1512  by (simp add: "RA[1]" "contraposition:1[1]" "deduction-theorem" "≡I" "logic-actual"[act_axiom_inst])
1513
1514AOT_act_theorem "ANeg:2": ¬𝒜¬φ  φ
1515  using "ANeg:1" "≡I" "≡E"(5) "useful-tautologies:1" "useful-tautologies:2" by blast
1516
1517AOT_theorem "Act-Basic:1": 𝒜φ  𝒜¬φ
1518  by (meson "∨I"(1,2) "≡E"(2) "logic-actual-nec:1"[axiom_inst] "raa-cor:1")
1519
1520AOT_theorem "Act-Basic:2": 𝒜(φ & ψ)  (𝒜φ & 𝒜ψ)
1521proof (rule "≡I"; rule "→I")
1522  AOT_assume 𝒜(φ & ψ)
1523  moreover AOT_have 𝒜((φ & ψ)  φ)
1524    by (simp add: "RA[2]" "Conjunction Simplification"(1))
1525  moreover AOT_have 𝒜((φ & ψ)  ψ)
1526    by (simp add: "RA[2]" "Conjunction Simplification"(2))
1527  ultimately AOT_show 𝒜φ & 𝒜ψ
1528    using "act-cond"[THEN "→E", THEN "→E"] "&I" by metis
1529next
1530  AOT_assume 𝒜φ & 𝒜ψ
1531  AOT_thus 𝒜(φ & ψ)
1532    using "act-conj-act:3" "vdash-properties:6" by blast
1533qed
1534
1535AOT_theorem "Act-Basic:3": 𝒜(φ  ψ)  (𝒜(φ  ψ) & 𝒜(ψ  φ))
1536proof (rule "≡I"; rule "→I")
1537  AOT_assume 𝒜(φ  ψ)
1538  moreover AOT_have 𝒜((φ  ψ)  (φ  ψ))
1539    by (simp add: "RA[2]" "deduction-theorem" "≡E"(1))
1540  moreover AOT_have 𝒜((φ  ψ)  (ψ  φ))
1541    by (simp add: "RA[2]" "deduction-theorem" "≡E"(2))
1542  ultimately AOT_show 𝒜(φ  ψ) & 𝒜(ψ  φ)
1543    using "act-cond"[THEN "→E", THEN "→E"] "&I" by metis
1544next
1545  AOT_assume 𝒜(φ  ψ) & 𝒜(ψ  φ)
1546  AOT_hence 𝒜((φ  ψ) & (ψ  φ))
1547    by (metis "act-conj-act:3" "vdash-properties:10")
1548  moreover AOT_have 𝒜(((φ  ψ) & (ψ  φ))  (φ  ψ))
1549    by (simp add: "conventions:3" "RA[2]" "df-rules-formulas[2]" "vdash-properties:1[2]")
1550  ultimately AOT_show 𝒜(φ  ψ)
1551    using "act-cond"[THEN "→E", THEN "→E"] by metis
1552qed
1553
1554AOT_theorem "Act-Basic:4": (𝒜(φ  ψ) & 𝒜(ψ  φ))  (𝒜φ  𝒜ψ)
1555proof (rule "≡I"; rule "→I")
1556  AOT_assume 0: 𝒜(φ  ψ) & 𝒜(ψ  φ)
1557  AOT_show 𝒜φ  𝒜ψ
1558    using 0 "&E" "act-cond"[THEN "→E", THEN "→E"] "≡I" "→I" by metis
1559next
1560  AOT_assume 𝒜φ  𝒜ψ
1561  AOT_thus 𝒜(φ  ψ) & 𝒜(ψ  φ)
1562    by (metis "→I" "logic-actual-nec:2"[axiom_inst] "≡E"(1,2) "&I")
1563qed
1564
1565AOT_theorem "Act-Basic:5": 𝒜(φ  ψ)  (𝒜φ  𝒜ψ)
1566  using "Act-Basic:3" "Act-Basic:4" "≡E"(5) by blast
1567
1568AOT_theorem "Act-Basic:6": 𝒜φ  𝒜φ
1569  by (simp add: "≡I" "qml:2"[axiom_inst] "qml-act:1"[axiom_inst])
1570
1571AOT_theorem "Act-Basic:7": 𝒜φ  𝒜φ
1572  by (metis "Act-Basic:6" "→I" "→E" "≡E"(1,2) "nec-imp-act" "qml-act:2"[axiom_inst])
1573
1574AOT_theorem "Act-Basic:8": φ  𝒜φ
1575  using "Hypothetical Syllogism" "nec-imp-act" "qml-act:1"[axiom_inst] by blast
1576
1577AOT_theorem "Act-Basic:9": 𝒜(φ  ψ)  (𝒜φ  𝒜ψ)
1578proof (rule "≡I"; rule "→I")
1579  AOT_assume 𝒜(φ  ψ)
1580  AOT_thus 𝒜φ  𝒜ψ
1581  proof (rule "raa-cor:3")
1582    AOT_assume ¬(𝒜φ  𝒜ψ)
1583    AOT_hence ¬𝒜φ & ¬𝒜ψ
1584      by (metis "≡E"(1) "oth-class-taut:5:d")
1585    AOT_hence 𝒜¬φ & 𝒜¬ψ
1586      using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] "&E" "&I" by metis
1587    AOT_hence 𝒜(¬φ & ¬ψ)
1588      using "≡E" "Act-Basic:2" by metis
1589    moreover AOT_have 𝒜((¬φ & ¬ψ)  ¬(φ  ψ))
1590      using "RA[2]" "≡E"(6) "oth-class-taut:3:a" "oth-class-taut:5:d" by blast
1591    moreover AOT_have 𝒜(¬φ & ¬ψ)  𝒜(¬(φ  ψ))
1592      using calculation(2) by (metis "Act-Basic:5" "≡E"(1))
1593    ultimately AOT_have 𝒜(¬(φ  ψ)) using "≡E" by blast
1594    AOT_thus ¬𝒜(φ  ψ)
1595      using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(1)] by auto
1596  qed
1597next
1598  AOT_assume 𝒜φ  𝒜ψ
1599  AOT_thus 𝒜(φ  ψ)
1600    by (meson "RA[2]" "act-cond" "∨I"(1) "∨E"(1) "Disjunction Addition"(1) "Disjunction Addition"(2))
1601qed
1602
1603AOT_theorem "Act-Basic:10": 𝒜α φ{α}  α 𝒜φ{α}
1604proof -
1605  AOT_have θ: ¬𝒜α ¬φ{α}  ¬α 𝒜¬φ{α}
1606    by (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
1607       (metis "logic-actual-nec:3"[axiom_inst])
1608  AOT_have ξ: ¬α 𝒜¬φ{α}  ¬α ¬𝒜φ{α}
1609    by (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
1610       (rule "logic-actual-nec:1"[THEN universal_closure, axiom_inst, THEN "cqt-basic:3"[THEN "→E"]])
1611  AOT_have 𝒜(α φ{α})  𝒜(¬α ¬φ{α})
1612    using "conventions:4"[THEN "df-rules-formulas[1]", THEN act_closure, axiom_inst]
1613          "conventions:4"[THEN "df-rules-formulas[2]", THEN act_closure, axiom_inst]
1614    "Act-Basic:4"[THEN "≡E"(1)] "&I" "Act-Basic:5"[THEN "≡E"(2)] by metis
1615  also AOT_have   ¬𝒜α ¬φ{α}
1616    by (simp add: "logic-actual-nec:1" "vdash-properties:1[2]")
1617  also AOT_have   ¬α 𝒜 ¬φ{α} using θ by blast
1618  also AOT_have   ¬α ¬𝒜 φ{α} using ξ by blast
1619  also AOT_have   α 𝒜 φ{α}
1620    using "conventions:4"[THEN "≡Df"] by (metis "≡E"(6) "oth-class-taut:3:a")
1621  finally AOT_show 𝒜α φ{α}  α 𝒜φ{α} .
1622qed
1623
1624
1625AOT_theorem "Act-Basic:11": 𝒜α(φ{α}  ψ{α})  α(𝒜φ{α}  𝒜ψ{α})
1626proof(rule "≡I"; rule "→I")
1627  AOT_assume 𝒜α(φ{α}  ψ{α})
1628  AOT_hence α𝒜(φ{α}  ψ{α})
1629    using "logic-actual-nec:3"[axiom_inst, THEN "≡E"(1)] by blast
1630  AOT_hence 𝒜(φ{α}  ψ{α}) for α using "∀E" by blast
1631  AOT_hence 𝒜φ{α}  𝒜ψ{α} for α by (metis "Act-Basic:5" "≡E"(1))
1632  AOT_thus α(𝒜φ{α}  𝒜ψ{α}) by (rule "∀I")
1633next
1634  AOT_assume α(𝒜φ{α}  𝒜ψ{α})
1635  AOT_hence 𝒜φ{α}  𝒜ψ{α} for α using "∀E" by blast
1636  AOT_hence 𝒜(φ{α}  ψ{α}) for α by (metis "Act-Basic:5" "≡E"(2))
1637  AOT_hence α 𝒜(φ{α}  ψ{α}) by (rule "∀I")
1638  AOT_thus 𝒜α(φ{α}  ψ{α})
1639    using "logic-actual-nec:3"[axiom_inst, THEN "≡E"(2)] by fast
1640qed
1641
1642AOT_act_theorem "act-quant-uniq": β(𝒜φ{β}  β = α)  β(φ{β}  β = α)
1643proof(rule "≡I"; rule "→I")
1644  AOT_assume β(𝒜φ{β}  β = α)
1645  AOT_hence 𝒜φ{β}  β = α for β using "∀E" by blast
1646  AOT_hence φ{β}  β = α for β
1647    using "≡I" "→I" "RA[1]" "≡E"(1) "≡E"(2) "logic-actual"[act_axiom_inst] "vdash-properties:6"
1648    by metis
1649  AOT_thus β(φ{β}  β = α) by (rule "∀I")
1650next
1651  AOT_assume β(φ{β}  β = α)
1652  AOT_hence φ{β}  β = α for β using "∀E" by blast
1653  AOT_hence 𝒜φ{β}  β = α for β
1654    using "≡I" "→I" "RA[1]" "≡E"(1) "≡E"(2) "logic-actual"[act_axiom_inst] "vdash-properties:6"
1655    by metis
1656  AOT_thus β(𝒜φ{β}  β = α) by (rule "∀I")
1657qed
1658
1659AOT_act_theorem "fund-cont-desc": x = ιx(φ{x})  z(φ{z}  z = x)
1660  using descriptions[axiom_inst] "act-quant-uniq" "≡E"(5) by fast
1661
1662AOT_act_theorem hintikka: x = ιx(φ{x})  (φ{x} & z (φ{z}  z = x))
1663  using "Commutativity of ≡"[THEN "≡E"(1)] "term-out:3" "fund-cont-desc" "≡E"(5) by blast
1664
1665
1666locale russel_axiom =
1667  fixes ψ
1668  assumes ψ_denotes_asm: "[v  ψ{κ}]  [v  κ]"
1669begin
1670AOT_act_theorem "russell-axiom": ψ{ιx φ{x}}  x(φ{x} & z(φ{z}  z = x) & ψ{x})
1671proof -
1672  AOT_have b: x (x = ιx φ{x}  (φ{x} & z(φ{z}  z = x)))
1673    using hintikka "∀I" by fast
1674  show ?thesis
1675  proof(rule "≡I"; rule "→I")
1676    AOT_assume c: ψ{ιx φ{x}}
1677    AOT_hence d: ιx φ{x} using ψ_denotes_asm by blast
1678    AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1679    then AOT_obtain a where a_def: a = ιx φ{x} using "instantiation"[rotated] by blast
1680    moreover AOT_have a = ιx φ{x}  (φ{a} & z(φ{z}  z = a)) using b "∀E" by blast
1681    ultimately AOT_have φ{a} & z(φ{z}  z = a) using "≡E" by blast
1682    moreover AOT_have ψ{a}
1683    proof - 
1684      AOT_have 1: xy(x = y  y = x)
1685        by (simp add: "id-eq:2" "universal-cor")
1686      AOT_have a = ιx φ{x}   ιx φ{x} = a
1687        by (rule "∀E"(1)[where τ="«ιx φ{x}»"]; rule "∀E"(2)[where β=a])
1688           (auto simp: 1 d "universal-cor")
1689      AOT_thus ψ{a}
1690        using a_def c "rule=E" "→E" by blast
1691    qed
1692    ultimately AOT_have φ{a} & z(φ{z}  z = a) & ψ{a} by (rule "&I")
1693    AOT_thus x(φ{x} & z(φ{z}  z = x) & ψ{x}) by (rule "∃I")
1694  next
1695    AOT_assume x(φ{x} & z(φ{z}  z = x) & ψ{x})
1696    then AOT_obtain b where g: φ{b} & z(φ{z}  z = b) & ψ{b} using "instantiation"[rotated] by blast
1697    AOT_hence h: b = ιx φ{x}  (φ{b} & z(φ{z}  z = b)) using b "∀E" by blast
1698    AOT_have φ{b} & z(φ{z}  z = b) and j: ψ{b} using g "&E" by blast+
1699    AOT_hence b = ιx φ{x} using h "≡E" by blast
1700    AOT_thus ψ{ιx φ{x}} using j "rule=E" by blast
1701  qed
1702qed
1703end
1704
1705(* TODO: this nicely shows off using locales with the embedding, but maybe there is still a nicer way *)
1706(* TODO: sledgehammer tends to refer to ψ_denotes_asm in these instantiation instead of referring
1707         to cqt:5:a - should be fixed *)
1708interpretation "russell-axiom[exe,1]": russel_axiom λ κ . «[Π]κ»
1709  by standard (metis "cqt:5:a[1]"[axiom_inst, THEN "→E"] "&E"(2))
1710interpretation "russell-axiom[exe,2,1,1]": russel_axiom λ κ . «[Π]κκ'»
1711  by standard (metis "cqt:5:a[2]"[axiom_inst, THEN "→E"] "&E")
1712interpretation "russell-axiom[exe,2,1,2]": russel_axiom λ κ . «[Π]κ'κ»
1713  by standard (metis "cqt:5:a[2]"[axiom_inst, THEN "→E"] "&E"(2))
1714interpretation "russell-axiom[exe,2,2]": russel_axiom λ κ . «[Π]κκ»
1715  by standard (metis "cqt:5:a[2]"[axiom_inst, THEN "→E"] "&E"(2))
1716interpretation "russell-axiom[exe,3,1,1]": russel_axiom λ κ . «[Π]κκ'κ''»
1717  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E")
1718interpretation "russell-axiom[exe,3,1,2]": russel_axiom λ κ . «[Π]κ'κκ''»
1719  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E")
1720interpretation "russell-axiom[exe,3,1,3]": russel_axiom λ κ . «[Π]κ'κ''κ»
1721  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E"(2))
1722interpretation "russell-axiom[exe,3,2,1]": russel_axiom λ κ . «[Π]κκκ'»
1723  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E")
1724interpretation "russell-axiom[exe,3,2,2]": russel_axiom λ κ . «[Π]κκ'κ»
1725  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E"(2))
1726interpretation "russell-axiom[exe,3,2,3]": russel_axiom λ κ . «[Π]κ'κκ»
1727  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E"(2))
1728interpretation "russell-axiom[exe,3,3]": russel_axiom λ κ . «[Π]κκκ»
1729  by standard (metis "cqt:5:a[3]"[axiom_inst, THEN "→E"] "&E"(2))
1730
1731interpretation "russell-axiom[enc,1]": russel_axiom λ κ . «κ[Π]»
1732  by standard (metis "cqt:5:b[1]"[axiom_inst, THEN "→E"] "&E"(2))
1733interpretation "russell-axiom[enc,2,1]": russel_axiom λ κ . «κκ'[Π]»
1734  by standard (metis "cqt:5:b[2]"[axiom_inst, THEN "→E"] "&E")
1735interpretation "russell-axiom[enc,2,2]": russel_axiom λ κ . «κ'κ[Π]»
1736  by standard (metis "cqt:5:b[2]"[axiom_inst, THEN "→E"] "&E"(2))
1737interpretation "russell-axiom[enc,2,3]": russel_axiom λ κ . «κκ[Π]»
1738  by standard (metis "cqt:5:b[2]"[axiom_inst, THEN "→E"] "&E"(2))
1739interpretation "russell-axiom[enc,3,1,1]": russel_axiom λ κ . «κκ'κ''[Π]»
1740  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E")
1741interpretation "russell-axiom[enc,3,1,2]": russel_axiom λ κ . «κ'κκ''[Π]»
1742  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E")
1743interpretation "russell-axiom[enc,3,1,3]": russel_axiom λ κ . «κ'κ''κ[Π]»
1744  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E"(2))
1745interpretation "russell-axiom[enc,3,2,1]": russel_axiom λ κ . «κκκ'[Π]»
1746  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E")
1747interpretation "russell-axiom[enc,3,2,2]": russel_axiom λ κ . «κκ'κ[Π]»
1748  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E"(2))
1749interpretation "russell-axiom[enc,3,2,3]": russel_axiom λ κ . «κ'κκ[Π]»
1750  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E"(2))
1751interpretation "russell-axiom[enc,3,3]": russel_axiom λ κ . «κκκ[Π]»
1752  by standard (metis "cqt:5:b[3]"[axiom_inst, THEN "→E"] "&E"(2))
1753
1754AOT_act_theorem "1-exists:1": ιx φ{x}  ∃!x φ{x}
1755proof(rule "≡I"; rule "→I")
1756  AOT_assume ιx φ{x}
1757  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1758  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1759  AOT_hence φ{a} & z (φ{z}  z = a) using hintikka "≡E" by blast
1760  AOT_hence x (φ{x} & z (φ{z}  z = x)) by (rule "∃I")
1761  AOT_thus ∃!x φ{x} using "uniqueness:1"[THEN "≡dfI"] by blast
1762next
1763  AOT_assume ∃!x φ{x}
1764  AOT_hence x (φ{x} & z (φ{z}  z = x))
1765    using "uniqueness:1"[THEN "≡dfE"] by blast
1766  then AOT_obtain b where φ{b} & z (φ{z}  z = b) using "instantiation"[rotated] by blast
1767  AOT_hence b = ιx φ{x} using hintikka "≡E" by blast
1768  AOT_thus ιx φ{x} by (metis "t=t-proper:2" "vdash-properties:6")
1769qed
1770
1771AOT_act_theorem "1-exists:2": y(y=ιx φ{x})  ∃!x φ{x}
1772  using "1-exists:1" "free-thms:1" "≡E"(6) by blast
1773
1774AOT_act_theorem "y-in:1": x = ιx φ{x}  φ{x}
1775  using "&E"(1) "→I" hintikka "≡E"(1) by blast
1776
1777AOT_act_theorem "y-in:2": z = ιx φ{x}  φ{z} using "y-in:1". (* TODO: same as above *)
1778
1779AOT_act_theorem "y-in:3": ιx φ{x}  φ{ιx φ{x}}
1780proof(rule "→I")
1781  AOT_assume ιx φ{x}
1782  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1783  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1784  moreover AOT_have φ{a} using calculation hintikka "≡E"(1) "&E" by blast
1785  ultimately AOT_show φ{ιx φ{x}} using "rule=E" by blast
1786qed
1787
1788AOT_act_theorem "y-in:4": y (y = ιx φ{x})  φ{ιx φ{x}}
1789  using "y-in:3"[THEN "→E"] "free-thms:1"[THEN "≡E"(2)] "→I" by blast
1790
1791
1792AOT_theorem "act-quant-nec": β (𝒜φ{β}  β = α)  β(𝒜𝒜φ{β}  β = α)
1793proof(rule "≡I"; rule "→I")
1794  AOT_assume β (𝒜φ{β}  β = α)
1795  AOT_hence 𝒜φ{β}  β = α for β using "∀E" by blast
1796  AOT_hence 𝒜𝒜φ{β}  β = α for β 
1797    by (metis "Act-Basic:5" "act-conj-act:4" "≡E"(1) "≡E"(5))
1798  AOT_thus β(𝒜𝒜φ{β}  β = α)
1799    by (rule "∀I")
1800next
1801  AOT_assume β(𝒜𝒜φ{β}  β = α)
1802  AOT_hence 𝒜𝒜φ{β}  β = α for β using "∀E" by blast
1803  AOT_hence 𝒜φ{β}  β = α for β
1804    by (metis "Act-Basic:5" "act-conj-act:4" "≡E"(1) "≡E"(6))
1805  AOT_thus β (𝒜φ{β}  β = α)
1806    by (rule "∀I")
1807qed
1808
1809AOT_theorem "equi-desc-descA:1": x = ιx φ{x}  x = ιx(𝒜φ{x})
1810proof -
1811  AOT_have x = ιx φ{x}  z (𝒜φ{z}  z = x)  using descriptions[axiom_inst] by blast
1812  also AOT_have ...  z (𝒜𝒜φ{z}  z = x)
1813  proof(rule "≡I"; rule "→I"; rule "∀I")
1814    AOT_assume z (𝒜φ{z}  z = x)
1815    AOT_hence 𝒜φ{a}  a = x for a using "∀E" by blast
1816    AOT_thus 𝒜𝒜φ{a}  a = x for a by (metis "Act-Basic:5" "act-conj-act:4" "≡E"(1) "≡E"(5))
1817  next
1818    AOT_assume z (𝒜𝒜φ{z}  z = x)
1819    AOT_hence 𝒜𝒜φ{a}  a = x for a using "∀E" by blast
1820    AOT_thus 𝒜φ{a}  a = x for a  by (metis "Act-Basic:5" "act-conj-act:4" "≡E"(1) "≡E"(6))
1821  qed
1822  also AOT_have ...  x = ιx(𝒜φ{x})
1823    using "Commutativity of ≡"[THEN "≡E"(1)] descriptions[axiom_inst] by fast
1824  finally show ?thesis .
1825qed
1826
1827AOT_theorem "equi-desc-descA:2": ιx φ{x}  ιx φ{x} = ιx(𝒜φ{x})
1828proof(rule "→I")
1829  AOT_assume ιx φ{x}
1830  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1831  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1832  moreover AOT_have a = ιx(𝒜φ{x}) using calculation "equi-desc-descA:1"[THEN "≡E"(1)] by blast
1833  ultimately AOT_show ιx φ{x} = ιx(𝒜φ{x}) using "rule=E" by fast
1834qed
1835
1836AOT_theorem "nec-hintikka-scheme": x = ιx φ{x}  𝒜φ{x} & z(𝒜φ{z}  z = x)
1837proof -
1838  AOT_have x = ιx φ{x}  z(𝒜φ{z}  z = x) using descriptions[axiom_inst] by blast
1839  also AOT_have   (𝒜φ{x} & z(𝒜φ{z}  z = x))
1840    using "Commutativity of ≡"[THEN "≡E"(1)] "term-out:3" by fast
1841  finally show ?thesis.
1842qed
1843
1844AOT_theorem "equiv-desc-eq:1": 𝒜x(φ{x}  ψ{x})  x (x = ιx φ{x}  x = ιx ψ{x})
1845proof(rule "→I"; rule "∀I")
1846  fix β
1847  AOT_assume 𝒜x(φ{x}  ψ{x})
1848  AOT_hence 𝒜(φ{x}  ψ{x}) for x using "logic-actual-nec:3"[axiom_inst, THEN "≡E"(1)] "∀E"(2) by blast
1849  AOT_hence 0: 𝒜φ{x}  𝒜ψ{x} for x by (metis "Act-Basic:5" "≡E"(1))
1850  AOT_have β = ιx φ{x}  𝒜φ{β} & z(𝒜φ{z}  z = β) using "nec-hintikka-scheme" by blast
1851  also AOT_have ...  𝒜ψ{β} & z(𝒜ψ{z}  z = β)
1852  proof (rule "≡I"; rule "→I")
1853    AOT_assume 1: 𝒜φ{β} & z(𝒜φ{z}  z = β)
1854    AOT_hence 𝒜φ{z}  z = β for z using "&E" "∀E" by blast
1855    AOT_hence 𝒜ψ{z}  z = β for z using 0 "≡E" "→I" "→E" by metis
1856    AOT_hence z(𝒜ψ{z}  z = β) using "∀I" by fast
1857    moreover AOT_have 𝒜ψ{β} using "&E" 0[THEN "≡E"(1)] 1 by blast
1858    ultimately AOT_show 𝒜ψ{β} & z(𝒜ψ{z}  z = β) using "&I" by blast
1859  next
1860    AOT_assume 1: 𝒜ψ{β} & z(𝒜ψ{z}  z = β)
1861    AOT_hence 𝒜ψ{z}  z = β for z using "&E" "∀E" by blast
1862    AOT_hence 𝒜φ{z}  z = β for z using 0 "≡E" "→I" "→E" by metis
1863    AOT_hence z(𝒜φ{z}  z = β) using "∀I" by fast
1864    moreover AOT_have 𝒜φ{β} using "&E" 0[THEN "≡E"(2)] 1 by blast
1865    ultimately AOT_show 𝒜φ{β} & z(𝒜φ{z}  z = β) using "&I" by blast
1866  qed
1867  also AOT_have ...  β = ιx ψ{x}
1868    using "Commutativity of ≡"[THEN "≡E"(1)] "nec-hintikka-scheme" by blast
1869  finally AOT_show β = ιx φ{x}  β = ιx ψ{x} .
1870qed
1871
1872AOT_theorem "equiv-desc-eq:2": ιx φ{x} & 𝒜x(φ{x}  ψ{x})  ιx φ{x} = ιx ψ{x}
1873proof(rule "→I")
1874  AOT_assume ιx φ{x} & 𝒜x(φ{x}  ψ{x})
1875  AOT_hence 0: y (y = ιx φ{x}) and
1876            1: x (x = ιx φ{x}  x = ιx ψ{x})
1877    using "&E" "free-thms:1"[THEN "≡E"(1)] "equiv-desc-eq:1" "→E" by blast+
1878  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1879  moreover AOT_have a = ιx ψ{x} using calculation 1 "∀E" "≡E"(1) by fast
1880  ultimately AOT_show ιx φ{x} = ιx ψ{x}
1881    using "rule=E" by fast
1882qed
1883
1884AOT_theorem "equiv-desc-eq:3": ιx φ{x} & x(φ{x}  ψ{x})  ιx φ{x} = ιx ψ{x}
1885  using "→I" "equiv-desc-eq:2"[THEN "→E", OF "&I"] "&E" "nec-imp-act"[THEN "→E"] by metis
1886
1887(* Note: this is a special case of "exist-nec" *)
1888AOT_theorem "equiv-desc-eq:4": ιx φ{x}  ιx φ{x}
1889proof(rule "→I")
1890  AOT_assume ιx φ{x}
1891  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1892  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1893  AOT_thus ιx φ{x}
1894    using "ex:2:a" "rule=E" by fast
1895qed
1896
1897AOT_theorem "equiv-desc-eq:5": ιx φ{x}  y (y = ιx φ{x})
1898proof(rule "→I")
1899  AOT_assume ιx φ{x}
1900  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1901  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1902  AOT_hence (a = ιx φ{x}) by (metis "id-nec:2" "vdash-properties:10")
1903  AOT_thus y (y = ιx φ{x}) by (rule "∃I")
1904qed
1905
1906AOT_act_theorem "equiv-desc-eq2:1": x (φ{x}  ψ{x})  x (x = ιx φ{x}  x = ιx ψ{x})
1907  using "→I" "logic-actual"[act_axiom_inst, THEN "→E"] "equiv-desc-eq:1"[THEN "→E"]
1908        "RA[1]" "deduction-theorem" by blast
1909
1910AOT_act_theorem "equiv-desc-eq2:2": ιx φ{x} & x (φ{x}  ψ{x})  ιx φ{x} = ιx ψ{x}
1911  using "→I" "logic-actual"[act_axiom_inst, THEN "→E"] "equiv-desc-eq:2"[THEN "→E", OF "&I"]
1912        "RA[1]" "deduction-theorem" "&E" by metis
1913
1914context russel_axiom
1915begin
1916AOT_theorem "nec-russell-axiom": ψ{ιx φ{x}}  x(𝒜φ{x} & z(𝒜φ{z}  z = x) & ψ{x})
1917proof -
1918  AOT_have b: x (x = ιx φ{x}  (𝒜φ{x} & z(𝒜φ{z}  z = x)))
1919    using "nec-hintikka-scheme" "∀I" by fast
1920  show ?thesis
1921  proof(rule "≡I"; rule "→I")
1922    AOT_assume c: ψ{ιx φ{x}}
1923    AOT_hence d: ιx φ{x} using ψ_denotes_asm by blast
1924    AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1925    then AOT_obtain a where a_def: a = ιx φ{x} using "instantiation"[rotated] by blast
1926    moreover AOT_have a = ιx φ{x}  (𝒜φ{a} & z(𝒜φ{z}  z = a)) using b "∀E" by blast
1927    ultimately AOT_have 𝒜φ{a} & z(𝒜φ{z}  z = a) using "≡E" by blast
1928    moreover AOT_have ψ{a}
1929    proof - 
1930      AOT_have 1: xy(x = y  y = x)
1931        by (simp add: "id-eq:2" "universal-cor")
1932      AOT_have a = ιx φ{x}   ιx φ{x} = a
1933        by (rule "∀E"(1)[where τ="«ιx φ{x}»"]; rule "∀E"(2)[where β=a])
1934           (auto simp: d "universal-cor" 1)
1935      AOT_thus ψ{a}
1936        using a_def c "rule=E" "→E" by metis
1937    qed
1938    ultimately AOT_have 𝒜φ{a} & z(𝒜φ{z}  z = a) & ψ{a} by (rule "&I")
1939    AOT_thus x(𝒜φ{x} & z(𝒜φ{z}  z = x) & ψ{x}) by (rule "∃I")
1940  next
1941    AOT_assume x(𝒜φ{x} & z(𝒜φ{z}  z = x) & ψ{x})
1942    then AOT_obtain b where g: 𝒜φ{b} & z(𝒜φ{z}  z = b) & ψ{b} using "instantiation"[rotated] by blast
1943    AOT_hence h: b = ιx φ{x}  (𝒜φ{b} & z(𝒜φ{z}  z = b)) using b "∀E" by blast
1944    AOT_have 𝒜φ{b} & z(𝒜φ{z}  z = b) and j: ψ{b} using g "&E" by blast+
1945    AOT_hence b = ιx φ{x} using h "≡E" by blast
1946    AOT_thus ψ{ιx φ{x}} using j "rule=E" by blast
1947  qed
1948qed
1949end
1950
1951AOT_theorem "actual-desc:1": ιx φ{x}  ∃!x 𝒜φ{x}
1952proof (rule "≡I"; rule "→I")
1953  AOT_assume ιx φ{x}
1954  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1955  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1956  moreover AOT_have a = ιx φ{x}  z(𝒜φ{z}  z = a)
1957    using descriptions[axiom_inst] by blast
1958  ultimately AOT_have z(𝒜φ{z}  z = a)
1959    using "≡E" by blast
1960  AOT_hence xz(𝒜φ{z}  z = x) by (rule "∃I")
1961  AOT_thus ∃!x 𝒜φ{x}
1962    using "uniqueness:2"[THEN "≡E"(2)] by fast
1963next
1964  AOT_assume ∃!x 𝒜φ{x}
1965  AOT_hence xz(𝒜φ{z}  z = x)
1966    using "uniqueness:2"[THEN "≡E"(1)] by fast
1967  then AOT_obtain a where z(𝒜φ{z}  z = a) using "instantiation"[rotated] by blast
1968  moreover AOT_have a = ιx φ{x}  z(𝒜φ{z}  z = a)
1969    using descriptions[axiom_inst] by blast
1970  ultimately AOT_have a = ιx φ{x} using "≡E" by blast
1971  AOT_thus ιx φ{x} by (metis "t=t-proper:2" "vdash-properties:6")
1972qed
1973
1974AOT_theorem "actual-desc:2": x = ιx φ{x}  𝒜φ{x}
1975  using "&E"(1) "contraposition:1[2]" "≡E"(1) "nec-hintikka-scheme" "reductio-aa:2" "vdash-properties:9" by blast
1976
1977AOT_theorem "actual-desc:3": z = ιx φ{x}  𝒜φ{z}
1978  using "actual-desc:2". (* TODO: same as above *)
1979
1980AOT_theorem "actual-desc:4": ιx φ{x}  𝒜φ{ιx φ{x}}
1981proof(rule "→I")
1982  AOT_assume ιx φ{x}
1983  AOT_hence y (y = ιx φ{x}) by (metis "rule=I:1" "existential:1")
1984  then AOT_obtain a where a = ιx φ{x} using "instantiation"[rotated] by blast
1985  AOT_thus 𝒜φ{ιx φ{x}}
1986    using "actual-desc:2" "rule=E" "→E" by fast
1987qed
1988
1989(* TODO: take another look at proof in PLM *)
1990AOT_theorem "actual-desc:5": ιx φ{x} = ιx ψ{x}  𝒜x(φ{x}  ψ{x})
1991proof(rule "→I")
1992  AOT_assume 0: ιx φ{x} = ιx ψ{x}
1993  AOT_hence φ_down: ιx φ{x} and ψ_down: ιx ψ{x}
1994    using "t=t-proper:1" "t=t-proper:2" "vdash-properties:6" by blast+
1995  AOT_hence y (y = ιx φ{x}) and y (y = ιx ψ{x}) by (metis "rule=I:1" "existential:1")+
1996  then AOT_obtain a and b where a_eq: a = ιx φ{x} and b_eq: b = ιx ψ{x}
1997    using "instantiation"[rotated] by metis
1998
1999  AOT_have αβ (α = β  β = α) by (rule "∀I"; rule "∀I"; rule "id-eq:2")
2000  AOT_hence β (ιx φ{x} = β  β = ιx φ{x})
2001    using "∀E" φ_down by blast
2002  AOT_hence ιx φ{x} = ιx ψ{x}  ιx ψ{x} = ιx φ{x}
2003    using "∀E" ψ_down by blast
2004  AOT_hence 1: ιx ψ{x} = ιx φ{x} using 0
2005    "→E" by blast
2006
2007  AOT_have 𝒜φ{x}  𝒜ψ{x} for x
2008  proof(rule "≡I"; rule "→I")
2009    AOT_assume 𝒜φ{x}
2010    moreover AOT_have 𝒜φ{x}  x = a for x
2011      using "nec-hintikka-scheme"[THEN "≡E"(1), OF a_eq, THEN "&E"(2)] "∀E" by blast
2012    ultimately AOT_have x = a using "→E" by blast
2013    AOT_hence x = ιx φ{x} using a_eq "rule=E" by blast
2014    AOT_hence x = ιx ψ{x} using 0 "rule=E" by blast
2015    AOT_thus 𝒜ψ{x} by (metis "actual-desc:3" "vdash-properties:6")
2016  next
2017    AOT_assume 𝒜ψ{x}
2018    moreover AOT_have 𝒜ψ{x}  x = b for x
2019      using "nec-hintikka-scheme"[THEN "≡E"(1), OF b_eq, THEN "&E"(2)] "∀E" by blast
2020    ultimately AOT_have x = b using "→E" by blast
2021    AOT_hence x = ιx ψ{x} using b_eq "rule=E" by blast
2022    AOT_hence x = ιx φ{x} using 1 "rule=E" by blast
2023    AOT_thus 𝒜φ{x} by (metis "actual-desc:3" "vdash-properties:6")
2024  qed
2025  AOT_hence 𝒜(φ{x}  ψ{x}) for x by (metis "Act-Basic:5" "≡E"(2))
2026  AOT_hence x 𝒜(φ{x}  ψ{x}) by (rule "∀I")
2027  AOT_thus 𝒜x (φ{x}  ψ{x})
2028    using "logic-actual-nec:3"[axiom_inst, THEN "≡E"(2)] by fast
2029qed    
2030
2031AOT_theorem "!box-desc:1": ∃!x φ{x}  y (y = ιx φ{x}  φ{y})
2032proof(rule "→I")
2033  AOT_assume ∃!x φ{x}
2034  AOT_hence ζ: x (φ{x} & z (φ{z}  z = x))
2035    using "uniqueness:1"[THEN "≡dfE"] by blast
2036  then AOT_obtain b where θ: φ{b} & z (φ{z}  z = b) using "instantiation"[rotated] by blast
2037  AOT_show y (y = ιx φ{x}  φ{y})
2038  proof(rule GEN; rule "→I")
2039    fix y
2040    AOT_assume y = ιx φ{x}
2041    AOT_hence 𝒜φ{y} & z (𝒜φ{z}  z = y) using "nec-hintikka-scheme"[THEN "≡E"(1)] by blast
2042    AOT_hence 𝒜φ{b}  b = y using "&E" "∀E" by blast
2043    moreover AOT_have 𝒜φ{b} using θ[THEN "&E"(1)]  by (metis "nec-imp-act" "→E")
2044    ultimately AOT_have b = y using "→E" by blast
2045    moreover AOT_have φ{b} using θ[THEN "&E"(1)]  by (metis "qml:2"[axiom_inst] "→E") 
2046    ultimately AOT_show φ{y} using "rule=E" by blast
2047  qed
2048qed
2049
2050AOT_theorem "!box-desc:2": x (φ{x}  φ{x})  (∃!x φ{x}  y (y = ιx φ{x}  φ{y}))
2051proof(rule "→I"; rule "→I")
2052  AOT_assume x (φ{x}  φ{x})
2053  moreover AOT_assume ∃!x φ{x}
2054  ultimately AOT_have ∃!x φ{x}
2055    using "nec-exist-!"[THEN "→E", THEN "→E"] by blast
2056  AOT_thus y (y = ιx φ{x}  φ{y})
2057    using "!box-desc:1" "→E" by blast
2058qed
2059
2060AOT_theorem "dr-alphabetic-thm": ιν φ{ν}  ιν φ{ν} = ιμ φ{μ} (* TODO: vacuous *)
2061  by (simp add: "rule=I:1" "→I")
2062
2063AOT_theorem "RM:1[prem]": assumes Γ  φ  ψ shows Γ  φ  ψ
2064proof -
2065  AOT_have Γ  (φ  ψ) using "RN[prem]" assms by blast
2066  AOT_thus Γ  φ  ψ by (metis "qml:1"[axiom_inst] "→E")
2067qed
2068
2069AOT_theorem "RM:1": assumes  φ  ψ shows  φ  ψ
2070  using "RM:1[prem]" assms by blast
2071
2072lemmas RM = "RM:1"
2073
2074AOT_theorem "RM:2[prem]": assumes Γ  φ  ψ shows Γ  φ  ψ
2075proof -
2076  AOT_have Γ  ¬ψ  ¬φ using assms 
2077    by (simp add: "contraposition:1[1]")
2078  AOT_hence Γ  ¬ψ  ¬φ using "RM:1[prem]" by blast
2079  AOT_thus Γ  φ  ψ
2080    by (meson "≡dfE" "≡dfI" "conventions:5" "deduction-theorem" "modus-tollens:1")
2081qed
2082
2083AOT_theorem "RM:2": assumes  φ  ψ shows  φ  ψ
2084  using "RM:2[prem]" assms by blast
2085
2086lemmas "RM◇" = "RM:2"
2087
2088AOT_theorem "RM:3[prem]": assumes Γ  φ  ψ shows Γ  φ  ψ
2089proof -
2090  AOT_have Γ  φ  ψ and Γ  ψ  φ using assms "≡E" "→I" by metis+
2091  AOT_hence Γ  φ  ψ and Γ  ψ  φ using "RM:1[prem]" by metis+
2092  AOT_thus Γ  φ  ψ
2093    by (simp add: "≡I")
2094qed
2095
2096AOT_theorem "RM:3": assumes  φ  ψ shows  φ  ψ
2097  using "RM:3[prem]" assms by blast
2098
2099lemmas RE = "RM:3"
2100
2101AOT_theorem "RM:4[prem]": assumes Γ  φ  ψ shows Γ  φ  ψ
2102proof -
2103  AOT_have Γ  φ  ψ and Γ  ψ  φ using assms "≡E" "→I" by metis+
2104  AOT_hence Γ  φ  ψ and Γ  ψ  φ using "RM:2[prem]" by metis+
2105  AOT_thus Γ  φ  ψ by (simp add: "≡I")
2106qed
2107
2108AOT_theorem "RM:4": assumes  φ  ψ shows  φ  ψ
2109  using "RM:4[prem]" assms by blast
2110
2111lemmas "RE◇" = "RM:4"
2112
2113AOT_theorem "KBasic:1": φ  (ψ  φ)
2114  by (simp add: RM "pl:1"[axiom_inst])
2115
2116AOT_theorem "KBasic:2": ¬φ  (φ  ψ)
2117  by (simp add: RM "useful-tautologies:3")
2118
2119AOT_theorem "KBasic:3": (φ & ψ)  (φ & ψ)
2120proof (rule "≡I"; rule "→I")
2121  AOT_assume (φ & ψ)
2122  AOT_thus φ & ψ
2123    by (meson RM "&I" "Conjunction Simplification"(1) "Conjunction Simplification"(2) "vdash-properties:6")
2124next
2125  AOT_have φ  (ψ  (φ & ψ)) by (simp add: "RM:1" Adjunction)
2126  AOT_hence φ  (ψ  (φ & ψ))  by (metis "Hypothetical Syllogism" "qml:1"[axiom_inst])
2127  moreover AOT_assume φ & ψ
2128  ultimately AOT_show (φ & ψ)
2129    using "→E" "&E" by blast
2130qed
2131
2132AOT_theorem "KBasic:4": (φ  ψ)  ((φ  ψ) & (ψ  φ))
2133proof -
2134  AOT_have θ: ((φ  ψ) & (ψ  φ))  ((φ  ψ) & (ψ  φ))
2135    by (fact "KBasic:3")
2136  AOT_modally_strict {
2137    AOT_have (φ  ψ)  ((φ  ψ) & (ψ  φ))
2138      by (fact "conventions:3"[THEN "≡Df"])
2139  }
2140  AOT_hence ξ: (φ  ψ)  ((φ  ψ) & (ψ  φ))
2141    by (rule RE)
2142  with ξ and θ AOT_show (φ  ψ)  ((φ  ψ) & (ψ  φ))
2143    using "≡E"(5) by blast
2144qed
2145
2146AOT_theorem "KBasic:5": ((φ  ψ) & (ψ  φ))  (φ  ψ)
2147proof -
2148  AOT_have (φ  ψ)  (φ  ψ)
2149    by (fact "qml:1"[axiom_inst])
2150  moreover AOT_have (ψ  φ)  (ψ  φ)
2151    by (fact "qml:1"[axiom_inst])
2152  ultimately AOT_have ((φ  ψ) & (ψ  φ))  ((φ  ψ) & (ψ  φ))
2153    by (metis "&I" MP "Double Composition")
2154  moreover AOT_have ((φ  ψ) & (ψ  φ))  (φ  ψ)
2155    using "conventions:3"[THEN "≡dfI"] "→I" by blast
2156  ultimately AOT_show ((φ  ψ) & (ψ  φ))  (φ  ψ)
2157    by (metis "Hypothetical Syllogism")
2158qed
2159
2160AOT_theorem "KBasic:6": (φ ψ)  (φ  ψ)
2161  using "KBasic:4" "KBasic:5" "deduction-theorem" "≡E"(1) "vdash-properties:10" by blast
2162AOT_theorem "KBasic:7": ((φ & ψ)  (¬φ & ¬ψ))  (φ  ψ)
2163proof (rule "→I"; drule "∨E"(1); (rule "→I")?)
2164  AOT_assume φ & ψ
2165  AOT_hence φ and ψ using "&E" by blast+
2166  AOT_hence (φ  ψ) and (ψ  φ) using "KBasic:1" "→E" by blast+
2167  AOT_hence (φ  ψ) & (ψ  φ) using "&I" by blast
2168  AOT_thus (φ  ψ)  by (metis "KBasic:4" "≡E"(2))
2169next
2170  AOT_assume ¬φ & ¬ψ
2171  AOT_hence 0: (¬φ & ¬ψ) using "KBasic:3"[THEN "≡E"(2)] by blast
2172  AOT_modally_strict {
2173    AOT_have (¬φ & ¬ψ)  (φ  ψ)
2174      by (metis "&E"(1) "&E"(2) "deduction-theorem" "≡I" "reductio-aa:1")
2175  }
2176  AOT_hence (¬φ & ¬ψ)  (φ  ψ)
2177    by (rule RM)
2178  AOT_thus (φ  ψ) using 0 "→E" by blast
2179qed(auto)
2180
2181AOT_theorem "KBasic:8": (φ & ψ)  (φ  ψ)
2182  by (meson "RM:1" "&E"(1) "&E"(2) "deduction-theorem" "≡I")
2183AOT_theorem "KBasic:9": (¬φ & ¬ψ)  (φ  ψ)
2184  by (metis "RM:1" "&E"(1) "&E"(2) "deduction-theorem" "≡I" "raa-cor:4")
2185AOT_theorem "KBasic:10": φ  ¬¬φ
2186  by (simp add: "RM:3" "oth-class-taut:3:b")
2187AOT_theorem "KBasic:11": ¬φ  ¬φ
2188proof (rule "≡I"; rule "→I")
2189  AOT_show ¬φ if ¬φ
2190    using that "≡dfI" "conventions:5" "KBasic:10" "≡E"(3) by blast
2191next
2192  AOT_show ¬φ if ¬φ
2193    using "≡dfE" "conventions:5" "KBasic:10" "≡E"(4) that by blast
2194qed
2195AOT_theorem "KBasic:12": φ  ¬¬φ
2196proof (rule "≡I"; rule "→I")
2197  AOT_show ¬¬φ if φ
2198    using "¬¬I" "KBasic:11" "≡E"(3) that by blast
2199next
2200  AOT_show φ if ¬¬φ
2201  using "KBasic:11" "≡E"(1) "reductio-aa:1" that by blast
2202qed
2203AOT_theorem "KBasic:13": (φ  ψ)  (φ  ψ)
2204proof -
2205  AOT_have φ  ψ  φ  ψ by blast
2206  AOT_hence (φ  ψ)  φ  ψ
2207    using "RM:2[prem]" by blast
2208  AOT_thus (φ  ψ)  (φ  ψ) using "→I" by blast
2209qed
2210lemmas "K◇" = "KBasic:13"
2211AOT_theorem "KBasic:14": φ  ¬¬φ
2212  by (meson "RE◇" "KBasic:11" "KBasic:12" "≡E"(6) "oth-class-taut:3:a")
2213AOT_theorem "KBasic:15": (φ  ψ)  (φ  ψ)
2214proof -
2215  AOT_modally_strict {
2216    AOT_have φ  (φ  ψ) and ψ  (φ  ψ)
2217      by (auto simp: "Disjunction Addition"(1) "Disjunction Addition"(2))
2218  }
2219  AOT_hence φ  (φ  ψ) and ψ  (φ  ψ)
2220    using RM by blast+
2221  AOT_thus (φ  ψ)  (φ  ψ)
2222    by (metis "∨E"(1) "deduction-theorem")
2223qed
2224
2225AOT_theorem "KBasic:16": (φ & ψ)  (φ & ψ)
2226  by (meson "KBasic:13" "RM:1" Adjunction "Hypothetical Syllogism" Importation "vdash-properties:6")
2227
2228AOT_theorem "rule-sub-lem:1:a":
2229  assumes  (ψ  χ)
2230  shows  ¬ψ  ¬χ
2231  using "qml:2"[axiom_inst, THEN "→E", OF assms]
2232        "≡E"(1) "oth-class-taut:4:b" by blast
2233
2234AOT_theorem "rule-sub-lem:1:b":
2235  assumes  (ψ  χ)
2236  shows  (ψ  Θ)  (χ  Θ)
2237  using "qml:2"[axiom_inst, THEN "→E", OF assms]
2238  using "oth-class-taut:4:c" "vdash-properties:6" by blast
2239
2240AOT_theorem "rule-sub-lem:1:c":
2241  assumes  (ψ  χ)
2242  shows  (Θ  ψ)  (Θ  χ)
2243  using "qml:2"[axiom_inst, THEN "→E", OF assms]
2244  using "oth-class-taut:4:d" "vdash-properties:6" by blast
2245
2246AOT_theorem "rule-sub-lem:1:d":
2247  assumes for arbitrary α:  (ψ{α}  χ{α})
2248  shows  α ψ{α}  α χ{α}
2249proof -
2250  AOT_modally_strict {
2251    AOT_have α (ψ{α}  χ{α})
2252      using "qml:2"[axiom_inst, THEN "→E", OF assms] "∀I" by fast
2253    AOT_hence 0: ψ{α}  χ{α} for α using "∀E" by blast
2254    AOT_show α ψ{α}  α χ{α}
2255    proof (rule "≡I"; rule "→I")
2256      AOT_assume α ψ{α}
2257      AOT_hence ψ{α} for α using "∀E" by blast
2258      AOT_hence χ{α} for α using 0 "≡E" by blast
2259      AOT_thus α χ{α} by (rule "∀I")
2260    next
2261      AOT_assume α χ{α}
2262      AOT_hence χ{α} for α using "∀E" by blast
2263      AOT_hence ψ{α} for α using 0 "≡E" by blast
2264      AOT_thus α ψ{α} by (rule "∀I")
2265    qed
2266  }
2267qed
2268
2269AOT_theorem "rule-sub-lem:1:e":
2270  assumes  (ψ  χ)
2271  shows   ψ]   χ]
2272  using "qml:2"[axiom_inst, THEN "→E", OF assms]
2273  using "≡E"(1) "propositions-lemma:6" by blast
2274
2275AOT_theorem "rule-sub-lem:1:f":
2276  assumes  (ψ  χ)
2277  shows  𝒜ψ  𝒜χ
2278  using "qml:2"[axiom_inst, THEN "→E", OF assms, THEN "RA[2]"]
2279  by (metis "Act-Basic:5" "≡E"(1))
2280
2281AOT_theorem "rule-sub-lem:1:g":
2282  assumes  (ψ  χ)
2283  shows  ψ  χ
2284  using "KBasic:6" assms "vdash-properties:6" by blast
2285
2286text‹Note that instead of deriving @{text "rule-sub-lem:2"}, @{text "rule-sub-lem:3"}, @{text "rule-sub-lem:4"},
2287     and @{text "rule-sub-nec"}, we construct substitution methods instead.›
2288
2289class AOT_subst =
2290  fixes AOT_subst :: "('a  𝗈)  bool"
2291    and AOT_subst_cond :: "'a  'a  bool"
2292  assumes AOT_subst: "AOT_subst φ  AOT_subst_cond ψ χ  [v  «φ ψ»  «φ χ»]"
2293
2294named_theorems AOT_substI
2295
2296instantiation 𝗈 :: AOT_subst
2297begin
2298
2299inductive AOT_subst_𝗈 where
2300  AOT_subst_𝗈_id[AOT_substI]: "AOT_subst_𝗈 (λφ. φ)"
2301| AOT_subst_𝗈_const[AOT_substI]: "AOT_subst_𝗈 (λφ. ψ)"
2302| AOT_subst_𝗈_not[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 (λ φ. «¬Θ{φ}»)"
2303| AOT_subst_𝗈_imp[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 Ξ  AOT_subst_𝗈 (λ φ. «Θ{φ}  Ξ{φ}»)"
2304| AOT_subst_𝗈_lambda0[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 (λ φ. (AOT_lambda0 (Θ φ)))"
2305| AOT_subst_𝗈_act[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 (λ φ. «𝒜Θ{φ}»)"
2306| AOT_subst_𝗈_box[AOT_substI]: "AOT_subst_𝗈 Θ  AOT_subst_𝗈 (λ φ. «Θ{φ}»)"
2307| AOT_subst_𝗈_by_def[AOT_substI]: "( ψ . AOT_model_equiv_def (Θ ψ) (Ξ ψ))  AOT_subst_𝗈 Ξ  AOT_subst_𝗈 Θ"
2308
2309definition AOT_subst_cond_𝗈 where "AOT_subst_cond_𝗈  λ ψ χ .  v . [v  ψ  χ]"
2310
2311instance
2312proof
2313  fix ψ χ :: 𝗈 and φ :: ‹𝗈  𝗈›
2314  assume cond: ‹AOT_subst_cond ψ χ
2315  assume ‹AOT_subst φ
2316  moreover AOT_have  ψ  χ using cond unfolding AOT_subst_cond_𝗈_def by blast
2317  ultimately AOT_show  φ{ψ}  φ{χ}
2318  proof (induct arbitrary: ψ χ)
2319    case AOT_subst_𝗈_id
2320    thus ?case using "≡E"(2) "oth-class-taut:4:b" "rule-sub-lem:1:a" by blast
2321  next
2322    case (AOT_subst_𝗈_const ψ)
2323    thus ?case by (simp add: "oth-class-taut:3:a")
2324  next
2325    case (AOT_subst_𝗈_not Θ)
2326    thus ?case by (simp add: RN "rule-sub-lem:1:a")
2327  next
2328    case (AOT_subst_𝗈_imp Θ Ξ)
2329    thus ?case by (meson RN "≡E"(5) "rule-sub-lem:1:b" "rule-sub-lem:1:c")
2330  next
2331    case (AOT_subst_𝗈_lambda0 Θ)
2332    thus ?case by (simp add: RN "rule-sub-lem:1:e")
2333  next
2334    case (AOT_subst_𝗈_act Θ)
2335    thus ?case by (simp add: RN "rule-sub-lem:1:f")
2336  next
2337    case (AOT_subst_𝗈_box Θ)
2338    thus ?case by (simp add: RN "rule-sub-lem:1:g")
2339  next
2340    case (AOT_subst_𝗈_by_def Θ Ξ)
2341    AOT_modally_strict {
2342      AOT_have Ξ{ψ}  Ξ{χ} using AOT_subst_𝗈_by_def by simp
2343      AOT_thus Θ{ψ}  Θ{χ}
2344        using "≡Df"[OF AOT_subst_𝗈_by_def(1), of _ ψ] "≡Df"[OF AOT_subst_𝗈_by_def(1), of _ χ]
2345        by (metis "≡E"(6) "oth-class-taut:3:a")
2346    }
2347  qed
2348qed
2349end
2350
2351instantiation "fun" :: (AOT_Term_id_2, AOT_subst) AOT_subst
2352begin
2353
2354definition AOT_subst_cond_fun :: "('a  'b)  ('a  'b)  bool" where
2355  "AOT_subst_cond_fun  λ φ ψ .  α . AOT_subst_cond (φ (AOT_term_of_var α)) (ψ (AOT_term_of_var α))"
2356
2357inductive AOT_subst_fun :: "(('a  'b)  𝗈)  bool" where
2358  AOT_subst_fun_const[AOT_substI]: "AOT_subst_fun (λφ. ψ)"
2359| AOT_subst_fun_id[AOT_substI]: "AOT_subst Ψ  AOT_subst_fun (λφ. Ψ (φ (AOT_term_of_var x)))"
2360| AOT_subst_fun_all[AOT_substI]: "AOT_subst Ψ  ( α . AOT_subst_fun (Θ (AOT_term_of_var α)))  AOT_subst_fun (λφ :: 'a  'b. Ψ «α «Θ (α::'a) φ»»)"
2361| AOT_subst_fun_not[AOT_substI]: "AOT_subst Ψ  AOT_subst_fun (λφ. «¬«Ψ φ»»)"
2362| AOT_subst_fun_imp[AOT_substI]: "AOT_subst Ψ  AOT_subst Θ  AOT_subst_fun (λφ. ««Ψ φ»  «Θ φ»»)"
2363| AOT_subst_fun_lambda0[AOT_substI]: "AOT_subst Θ  AOT_subst_fun (λ φ. (AOT_lambda0 (Θ φ)))"
2364| AOT_subst_fun_act[AOT_substI]: "AOT_subst Θ  AOT_subst_fun (λ φ. «𝒜«Θ φ»»)"
2365| AOT_subst_fun_box[AOT_substI]: "AOT_subst Θ  AOT_subst_fun (λ φ. ««Θ φ»»)"
2366| AOT_subst_fun_def[AOT_substI]: "( φ . AOT_model_equiv_def (Θ φ) (Ψ φ))  AOT_subst_fun Ψ  AOT_subst_fun Θ"
2367
2368instance proof
2369  fix ψ χ :: "'a  'b" and φ :: ('a  'b)  𝗈›
2370  assume ‹AOT_subst φ
2371  moreover assume cond: ‹AOT_subst_cond ψ χ
2372  ultimately AOT_show  «φ ψ»  «φ χ»
2373  proof(induct)
2374    case (AOT_subst_fun_const ψ)
2375    then show ?case by (simp add: "oth-class-taut:3:a")
2376  next
2377  case (AOT_subst_fun_id Ψ x)
2378  then show ?case by (simp add: AOT_subst AOT_subst_cond_fun_def) 
2379  next
2380  case (AOT_subst_fun_all Ψ Θ)
2381  AOT_have  (Θ{α, «ψ»}  Θ{α, «χ»}) for α
2382    using AOT_subst_fun_all.hyps(3) AOT_subst_fun_all.prems RN by presburger
2383  thus ?case using AOT_subst[OF AOT_subst_fun_all(1)]
2384    by (simp add: RN "rule-sub-lem:1:d" AOT_subst_cond_fun_def AOT_subst_cond_𝗈_def)
2385  next
2386  case (AOT_subst_fun_not Ψ)
2387  then show ?case by (simp add: RN "rule-sub-lem:1:a")
2388  next
2389  case (AOT_subst_fun_imp Ψ Θ)
2390  then show ?case 
2391    unfolding AOT_subst_cond_fun_def AOT_subst_cond_𝗈_def
2392    by (meson "≡E"(5) "oth-class-taut:4:c" "oth-class-taut:4:d" "vdash-properties:6")
2393  next
2394  case (AOT_subst_fun_lambda0 Θ)
2395  then show ?case by (simp add: RN "rule-sub-lem:1:e")
2396  next
2397  case (AOT_subst_fun_act Θ)
2398  then show ?case by (simp add: RN "rule-sub-lem:1:f")
2399  next
2400  case (AOT_subst_fun_box Θ)
2401  then show ?case by (simp add: RN "rule-sub-lem:1:g")
2402  next
2403  case (AOT_subst_fun_def Θ Ψ)
2404  then show ?case
2405    by (meson "df-rules-formulas[3]" "df-rules-formulas[4]" "≡I" "≡E"(5))
2406  qed
2407qed
2408end
2409
2410method_setup AOT_defI =
2411‹Scan.lift (Scan.succeed (fn ctxt => (Method.CONTEXT_METHOD (fn thms => (Context_Tactic.CONTEXT_SUBGOAL (fn (trm,int) => 
2412Context_Tactic.CONTEXT_TACTIC (
2413let
2414fun findHeadConst (Const x) = SOME x
2415  | findHeadConst (A $ B) = findHeadConst A
2416  | findHeadConst _ = NONE
2417fun findDef (Const (const_name‹AOT_model_equiv_def›, _) $ lhs $ rhs) = findHeadConst lhs
2418  | findDef (A $ B) = (case findDef A of SOME x => SOME x | _ => findDef B)
2419  | findDef (Abs (a,b,c)) = findDef c
2420  | findDef _ = NONE
2421val const_opt = (findDef trm)
2422val defs = case const_opt of SOME const => List.filter (fn thm => let
2423    val concl = Thm.concl_of thm
2424    val thmconst = (findDef concl)
2425    in case thmconst of SOME (c,_) => fst const = c | _ => false end) (AOT_Definitions.get ctxt)
2426    | _ => []
2427in
2428resolve_tac ctxt defs 1
2429end
2430)) 1)))))
2431‹Resolve AOT definitions›
2432
2433
2434method AOT_subst_intro_helper = ((rule AOT_substI
2435      | AOT_defI
2436      | (simp only: AOT_subst_cond_𝗈_def AOT_subst_cond_fun_def; ((rule allI)+)?)))
2437
2438method_setup AOT_subst = 2439Scan.option (Scan.lift (Args.parens (Args.$$$ "reverse"))) --
2440Scan.lift (Args.embedded_inner_syntax -- Args.embedded_inner_syntax
2441) -- Scan.option (Scan.lift (Args.$$$ "bound" -- Args.colon) |-- Scan.repeat1 (Scan.lift (Args.embedded_inner_syntax)))
2442>> (fn ((reversed,(raw_p,raw_q)),raw_bounds) => (fn ctxt =>
2443(Method.SIMPLE_METHOD (Subgoal.FOCUS (fn {context = ctxt, params = _, prems = prems, asms = asms, concl = concl, schematics = _} =>
2444let
2445val thms = prems
2446val ctxt' = ctxt
2447val ctxt = Context_Position.set_visible false ctxt
2448val raw_bounds = case raw_bounds of SOME bounds => bounds | _ => [] 
2449val bounds = (map (fn x => Syntax.check_term ctxt (AOT_read_term @{nonterminal τ'} ctxt x))) raw_bounds
2450
2451val p = AOT_read_term @{nonterminal φ'} ctxt raw_p
2452val p = Syntax.check_term ctxt p
2453val p = fold (fn bound => fn p => let in Term.abs ("α", Term.type_of bound) (Term.abstract_over (bound,p)) end) bounds p
2454val p = Syntax.check_term ctxt p
2455val p_ty = Term.type_of p
2456val pat = @{const Trueprop} $ (@{const AOT_model_valid_in} $ Var (("w",0), @{typ w}) $ (Var (("φ",0), Type (type_name‹fun›, [p_ty, @{typ 𝗈}])) $ p))
2457val univ = Unify.matchers (Context.Proof ctxt) [(pat, Thm.term_of concl)]
2458val univ = hd (Seq.list_of univ) (* TODO: choose? try all? filter? *)
2459val phi = the (Envir.lookup univ (("φ",0), Type (type_name‹fun›, [p_ty, @{typ 𝗈}])))
2460
2461val q = AOT_read_term @{nonterminal φ'} ctxt raw_q
2462val q = Syntax.check_term ctxt q
2463val q = fold (fn bound => fn q => let in Term.abs ("α", Term.type_of bound) (Term.abstract_over (bound,q)) end) bounds q
2464val q = Syntax.check_term ctxt q
2465
2466(* Reparse to report bounds as fixes. *)
2467val ctxt = Context_Position.restore_visible ctxt' ctxt
2468val ctxt' = ctxt
2469fun unsource str = fst (Input.source_content (Syntax.read_input str))
2470val (_,ctxt') = Proof_Context.add_fixes (map (fn str => (Binding.make (unsource str, Position.none), NONE, Mixfix.NoSyn)) raw_bounds) ctxt'
2471val _ = (map (fn x => Syntax.check_term ctxt (AOT_read_term @{nonterminal τ'} ctxt' x))) raw_bounds
2472val _ = AOT_read_term @{nonterminal φ'} ctxt' raw_p
2473val _ = AOT_read_term @{nonterminal φ'} ctxt' raw_q
2474
2475val abs = phi
2476val abs = HOLogic.mk_Trueprop (@{const AOT_subst(_)} $ abs)
2477val abs = Syntax.check_term ctxt abs
2478
2479val substThm = Goal.prove ctxt [] [] abs (fn {context=ctxt, prems=prems} =>
2480      REPEAT (SUBGOAL (fn (trm,int) => let
2481          fun findHeadConst (Const x) = SOME x
2482            | findHeadConst (A $ B) = findHeadConst A
2483            | findHeadConst _ = NONE
2484          fun findDef (Const (const_name‹AOT_model_equiv_def›, _) $ lhs $ rhs) = findHeadConst lhs
2485            | findDef (A $ B) = (case findDef A of SOME x => SOME x | _ => findDef B)
2486            | findDef (Abs (a,b,c)) = findDef c
2487            | findDef _ = NONE
2488          val const_opt = (findDef trm)
2489          val defs = case const_opt of SOME const => List.filter (fn thm => let
2490              val concl = Thm.concl_of thm
2491              val thmconst = (findDef concl)
2492              in case thmconst of SOME (c,_) => fst const = c | _ => false end) (AOT_Definitions.get ctxt)
2493              | _ => []
2494          val tac = case defs of [] => safe_step_tac (ctxt addSIs @{thms AOT_substI}) 1
2495                    | _ => resolve_tac ctxt defs 1
2496        in tac end) 1)
2497  )
2498val substThm = substThm RS @{thm AOT_subst}
2499val abs = Thm.cterm_of ctxt abs
2500val substThm = case reversed of NONE =>
2501  let
2502  val substThm = Drule.instantiate_normalize ([],[((("ψ", 0), p_ty), Thm.cterm_of ctxt p),
2503          ((("χ", 0), p_ty), Thm.cterm_of ctxt q)]) substThm
2504  val substThm = substThm RS @{thm "≡E"(2)}
2505  in substThm end
2506| _ =>   let
2507  val substThm = Drule.instantiate_normalize ([],[((("χ", 0), p_ty), Thm.cterm_of ctxt p),
2508          ((("ψ", 0), p_ty), Thm.cterm_of ctxt q)]) substThm
2509  val substThm = substThm RS @{thm "≡E"(1)}
2510  in substThm end
2511
2512in
2513resolve_tac ctxt [substThm] 1
2514THEN simp_tac (ctxt addsimps [@{thm AOT_subst_cond_𝗈_def}, @{thm AOT_subst_cond_fun_def}]) 1
2515THEN (REPEAT (resolve_tac ctxt [@{thm allI}] 1))
2516THEN (TRY (resolve_tac ctxt thms 1))
2517end
2518) ctxt 1))))
2519
2520
2521method AOT_subst_old for ψ::"'a::AOT_subst" and χ::"'a::AOT_subst" =
2522    (match conclusion in "[v  «φ ψ»]" for φ and v 
2523      match (φ) in "λa . ?p" fail¦ "λa . a" fail2524       ¦ _ rule AOT_subst[where φ=φ and ψ=ψ and χ=χ, THEN "≡E"(2)]
2525       ; (AOT_subst_intro_helper+)?››)
2526
2527method AOT_subst_old_rev for χ::"'a::AOT_subst" and ψ::"'a::AOT_subst" =
2528    (match conclusion in "[v  «φ ψ»]" for φ and v 
2529      match (φ) in "λa . ?p" fail¦ "λa . a" fail2530       ¦ _ rule AOT_subst[where φ=φ and ψ=χ and χ=ψ, THEN "≡E"(1)]
2531       ; (AOT_subst_intro_helper+)?››)
2532
2533method AOT_subst_manual for φ::"'a::AOT_subst  𝗈" =
2534    (rule AOT_subst[where φ=φ, THEN "≡E"(2)]; (AOT_subst_intro_helper+)?)
2535
2536method AOT_subst_manual_rev for φ::"'a::AOT_subst  𝗈" =
2537    (rule AOT_subst[where φ=φ, THEN "≡E"(1)]; (AOT_subst_intro_helper+)?)
2538
2539method AOT_subst_using uses subst =
2540    (match subst in "[?w  ψ  χ]" for ψ χ  2541       match conclusion in "[v  «φ ψ»]" for φ v 2542         rule AOT_subst[where φ=φ and ψ=ψ and χ=χ, THEN "≡E"(2)]
2543         ; ((AOT_subst_intro_helper | (fact subst; fail))+)?››)
2544
2545method AOT_subst_using_rev uses subst =
2546    (match subst in "[?w  ψ  χ]" for ψ χ  2547      match conclusion in "[v  «φ χ»]" for φ v 2548        rule AOT_subst[where φ=φ and ψ=ψ and χ=χ, THEN "≡E"(1)]
2549        ; ((AOT_subst_intro_helper | (fact subst; fail))+)?››)
2550
2551AOT_theorem "rule-sub-remark:1[1]": assumes  A!x  ¬E!x and ¬A!x shows ¬¬E!x
2552  by (AOT_subst (reverse) ¬E!x A!x)
2553     (auto simp: assms) 
2554
2555AOT_theorem "rule-sub-remark:1[2]": assumes  A!x  ¬E!x and  ¬¬E!x shows ¬A!x
2556  by (AOT_subst A!x ¬E!x)
2557     (auto simp: assms)
2558
2559AOT_theorem "rule-sub-remark:2[1]":
2560  assumes  [R]xy  ([R]xy & ([Q]a  ¬[Q]a)) and p  [R]xy shows p  [R]xy & ([Q]a  ¬[Q]a)
2561  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2562
2563AOT_theorem "rule-sub-remark:2[2]":
2564  assumes  [R]xy  ([R]xy & ([Q]a  ¬[Q]a)) and p  [R]xy & ([Q]a  ¬[Q]a) shows p  [R]xy
2565  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2566
2567AOT_theorem "rule-sub-remark:3[1]":
2568  assumes for arbitrary x:  A!x  ¬E!x
2569      and x A!x
2570    shows x ¬E!x
2571  by (AOT_subst (reverse) ¬E!x A!x bound: x)
2572     (auto simp: assms)
2573
2574AOT_theorem "rule-sub-remark:3[2]":
2575  assumes for arbitrary x:  A!x  ¬E!x
2576      and x ¬E!x
2577    shows x A!x
2578  by (AOT_subst A!x ¬E!x bound: x)
2579     (auto simp: assms)
2580
2581AOT_theorem "rule-sub-remark:4[1]":
2582  assumes  ¬¬[P]x  [P]x and 𝒜¬¬[P]x shows 𝒜[P]x
2583  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2584
2585AOT_theorem "rule-sub-remark:4[2]":
2586  assumes  ¬¬[P]x  [P]x and 𝒜[P]x shows 𝒜¬¬[P]x
2587  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2588
2589AOT_theorem "rule-sub-remark:5[1]":
2590  assumes  (φ  ψ)  (¬ψ  ¬φ) and (φ  ψ) shows (¬ψ  ¬φ)
2591  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2592
2593AOT_theorem "rule-sub-remark:5[2]":
2594  assumes  (φ  ψ)  (¬ψ  ¬φ) and (¬ψ  ¬φ) shows (φ  ψ) 
2595  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2596
2597AOT_theorem "rule-sub-remark:6[1]":
2598  assumes  ψ  χ and (φ  ψ) shows (φ  χ) 
2599  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2600
2601AOT_theorem "rule-sub-remark:6[2]":
2602  assumes  ψ  χ and (φ  χ) shows (φ  ψ)
2603  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2604
2605AOT_theorem "rule-sub-remark:7[1]":
2606  assumes  φ  ¬¬φ and (φ  φ) shows (¬¬φ  φ) 
2607  by (AOT_subst_using_rev subst: assms(1)) (simp add: assms(2))
2608
2609AOT_theorem "rule-sub-remark:7[2]":
2610  assumes  φ  ¬¬φ and (¬¬φ  φ) shows  (φ  φ)
2611  by (AOT_subst_using subst: assms(1)) (simp add: assms(2))
2612
2613AOT_theorem "KBasic2:1": ¬φ  ¬φ
2614  by (meson "conventions:5" "contraposition:2" "Hypothetical Syllogism" "df-rules-formulas[3]"
2615            "df-rules-formulas[4]" "≡I" "useful-tautologies:1")
2616
2617AOT_theorem "KBasic2:2": (φ  ψ)  (φ  ψ)
2618proof -
2619  AOT_have (φ  ψ)  ¬(¬φ & ¬ψ)
2620    by (simp add: "RE◇" "oth-class-taut:5:b")
2621  also AOT_have   ¬(¬φ & ¬ψ)
2622    using "KBasic:11" "≡E"(6) "oth-class-taut:3:a" by blast
2623  also AOT_have   ¬(¬φ & ¬ψ)
2624    using "KBasic:3" "≡E"(1) "oth-class-taut:4:b" by blast
2625  also AOT_have   ¬(¬φ & ¬ψ)
2626    using "KBasic2:1"
2627    by (AOT_subst ¬φ ¬φ; AOT_subst ¬ψ ¬ψ; auto simp: "oth-class-taut:3:a")
2628  also AOT_have   ¬¬(φ  ψ)
2629    using "≡E"(6) "oth-class-taut:3:b" "oth-class-taut:5:b" by blast
2630  also AOT_have   φ  ψ
2631    by (simp add: "≡I" "useful-tautologies:1" "useful-tautologies:2")
2632  finally show ?thesis .
2633qed
2634
2635AOT_theorem "KBasic2:3": (φ & ψ)  (φ & ψ)
2636  by (metis "RM◇" "&I" "Conjunction Simplification"(1) "Conjunction Simplification"(2) "deduction-theorem" "modus-tollens:1" "reductio-aa:1")
2637
2638AOT_theorem "KBasic2:4": (φ  ψ)  (φ  ψ)
2639proof -
2640  AOT_have (φ  ψ)  (¬φ  ψ)
2641    by (AOT_subst φ  ψ ¬φ  ψ)
2642       (auto simp: "oth-class-taut:1:c" "oth-class-taut:3:a")
2643  also AOT_have ...  ¬φ  ψ
2644    by (simp add: "KBasic2:2")
2645  also AOT_have ...  ¬φ  ψ
2646    by (AOT_subst ¬φ ¬φ)
2647       (auto simp: "KBasic:11" "oth-class-taut:3:a")
2648  also AOT_have ...  φ  ψ
2649    using "≡E"(6) "oth-class-taut:1:c" "oth-class-taut:3:a" by blast
2650  finally show ?thesis .
2651qed
2652
2653AOT_theorem "KBasic2:5": φ  ¬¬φ
2654  using "conventions:5"[THEN "≡Df"]
2655  by (AOT_subst φ ¬¬φ; AOT_subst ¬¬φ ¬¬¬¬φ; AOT_subst (reverse) ¬¬¬φ ¬φ)
2656     (auto simp: "oth-class-taut:3:b" "oth-class-taut:3:a")
2657
2658
2659AOT_theorem "KBasic2:6": (φ  ψ)  (φ  ψ)
2660proof(rule "→I"; rule "raa-cor:1")
2661  AOT_assume (φ  ψ)
2662  AOT_hence (¬φ  ψ)
2663    using "conventions:2"[THEN "≡Df"]
2664    by (AOT_subst (reverse) ¬φ  ψ φ  ψ) simp
2665  AOT_hence 1: ¬φ  ψ using "KBasic:13" "vdash-properties:10" by blast
2666  AOT_assume ¬(φ  ψ)
2667  AOT_hence ¬φ and ¬ψ using "&E" "≡E"(1) "oth-class-taut:5:d" by blast+
2668  AOT_thus ψ & ¬ψ using "&I"(1) 1[THEN "→E"] "KBasic:11" "≡E"(4) "raa-cor:3" by blast
2669qed
2670
2671AOT_theorem "KBasic2:7": ((φ  ψ) & ¬φ)  ψ
2672proof(rule "→I"; frule "&E"(1); drule "&E"(2))
2673  AOT_assume (φ  ψ)
2674  AOT_hence 1: φ  ψ
2675    using "KBasic2:6" "∨I"(2) "∨E"(1) by blast
2676  AOT_assume ¬φ
2677  AOT_hence ¬φ using "KBasic:11" "≡E"(2) by blast
2678  AOT_thus ψ using 1 "∨E"(2) by blast
2679qed
2680
2681AOT_theorem "T-S5-fund:1": φ  φ
2682  by (meson "≡dfI" "conventions:5" "contraposition:2" "Hypothetical Syllogism" "deduction-theorem" "qml:2"[axiom_inst])
2683lemmas "T◇" = "T-S5-fund:1"
2684
2685AOT_theorem "T-S5-fund:2": φ  φ
2686proof(rule "→I")
2687  AOT_assume φ
2688  AOT_hence ¬¬φ
2689    using "KBasic:14" "≡E"(4) "raa-cor:3" by blast
2690  moreover AOT_have ¬φ  ¬φ
2691    by (fact "qml:3"[axiom_inst])
2692  ultimately AOT_have ¬¬φ
2693    using "modus-tollens:1" by blast
2694  AOT_thus φ using "KBasic:12" "≡E"(2) by blast
2695qed
2696lemmas "5◇" = "T-S5-fund:2"
2697
2698(* Also interestingly none of these have proofs in PLM. *)
2699AOT_theorem "Act-Sub:1": 𝒜φ  ¬𝒜¬φ
2700  by (AOT_subst 𝒜¬φ ¬𝒜φ)
2701     (auto simp: "logic-actual-nec:1"[axiom_inst] "oth-class-taut:3:b")
2702
2703AOT_theorem "Act-Sub:2": φ  𝒜φ
2704  using "conventions:5"[THEN "≡Df"]
2705  by (AOT_subst φ ¬¬φ)
2706     (metis "deduction-theorem" "≡I" "≡E"(1) "≡E"(2) "≡E"(3)
2707            "logic-actual-nec:1"[axiom_inst] "qml-act:2"[axiom_inst])
2708
2709AOT_theorem "Act-Sub:3": 𝒜φ  φ
2710  using "conventions:5"[THEN "≡Df"]
2711  by (AOT_subst φ ¬¬φ)
2712     (metis "Act-Sub:1" "deduction-theorem" "≡E"(4) "nec-imp-act" "reductio-aa:2" "→E")
2713
2714
2715AOT_theorem "Act-Sub:4": 𝒜φ  𝒜φ
2716proof (rule "≡I"; rule "→I")
2717  AOT_assume 𝒜φ
2718  AOT_thus 𝒜φ using "T◇" "vdash-properties:10" by blast
2719next
2720  AOT_assume 𝒜φ
2721  AOT_hence ¬¬𝒜φ
2722    using "≡dfE" "conventions:5" by blast
2723  AOT_hence ¬𝒜¬φ
2724    by (AOT_subst 𝒜¬φ ¬𝒜φ)
2725       (simp add: "logic-actual-nec:1"[axiom_inst])
2726  AOT_thus 𝒜φ
2727      using "Act-Basic:1" "Act-Basic:6" "∨E"(3) "≡E"(4) "reductio-aa:1" by blast
2728qed
2729
2730AOT_theorem "Act-Sub:5": 𝒜φ  𝒜φ
2731  by (metis "Act-Sub:2" "Act-Sub:3" "Act-Sub:4" "deduction-theorem" "≡E"(1) "≡E"(2) "vdash-properties:6")
2732
2733AOT_theorem "S5Basic:1": φ  φ
2734  by (simp add: "≡I" "qml:2" "qml:3" "vdash-properties:1[2]")
2735
2736AOT_theorem "S5Basic:2": φ  φ
2737  by (simp add: "T◇" "5◇" "≡I")
2738
2739AOT_theorem "S5Basic:3": φ  φ
2740  using "T◇" "Hypothetical Syllogism" "qml:3" "vdash-properties:1[2]" by blast
2741lemmas "B" = "S5Basic:3"
2742
2743AOT_theorem "S5Basic:4": φ  φ
2744  using "5◇" "Hypothetical Syllogism" "qml:2" "vdash-properties:1[2]" by blast
2745lemmas "B◇" = "S5Basic:4"
2746
2747AOT_theorem "S5Basic:5": φ  φ
2748  using "RM:1" "B" "5◇" "Hypothetical Syllogism" by blast
2749lemmas "4" = "S5Basic:5"
2750
2751AOT_theorem "S5Basic:6": φ  φ
2752  by (simp add: "4" "≡I" "qml:2"[axiom_inst])
2753
2754AOT_theorem "S5Basic:7": φ  φ
2755  using "conventions:5"[THEN "≡Df"] "oth-class-taut:3:b"
2756  by (AOT_subst φ ¬¬φ;
2757      AOT_subst φ ¬¬φ;
2758      AOT_subst (reverse) ¬¬¬φ ¬φ;
2759      AOT_subst (reverse) ¬φ ¬φ)
2760     (auto simp: "S5Basic:6" "if-p-then-p")
2761
2762lemmas "4◇" = "S5Basic:7"
2763
2764AOT_theorem "S5Basic:8": φ  φ
2765  by (simp add: "4◇" "T◇" "≡I")
2766
2767AOT_theorem "S5Basic:9": (φ  ψ)  (φ  ψ)
2768  apply (rule "≡I"; rule "→I")
2769  using "KBasic2:6" "5◇" "∨I"(3) "if-p-then-p" "vdash-properties:10" apply blast
2770  by (meson "KBasic:15" "4" "∨I"(3) "∨E"(1) "Disjunction Addition"(1) "con-dis-taut:7"
2771            "intro-elim:1" "Commutativity of ∨")
2772
2773AOT_theorem "S5Basic:10": (φ  ψ)  (φ  ψ)
2774(* Note: nicely this proof is entirely sledgehammer generated *)
2775proof(rule "≡I"; rule "→I")
2776  AOT_assume (φ  ψ)
2777  AOT_hence φ  ψ
2778    by (meson "KBasic2:6" "∨I"(2) "∨E"(1))
2779  AOT_thus φ  ψ
2780    by (meson "B◇" "4" "4◇" "T◇" "∨I"(3))
2781next
2782  AOT_assume φ  ψ
2783  AOT_hence φ  ψ
2784    by (meson "S5Basic:1" "B◇" "S5Basic:6" "T◇" "5◇" "∨I"(3) "intro-elim:1")
2785  AOT_thus (φ  ψ)
2786    by (meson "KBasic:15" "∨I"(3) "∨E"(1) "Disjunction Addition"(1) "Disjunction Addition"(2))
2787qed
2788
2789AOT_theorem "S5Basic:11": (φ & ψ)  (φ & ψ)
2790proof -
2791  AOT_have (φ & ψ)  ¬(¬φ  ¬ψ)
2792    by (AOT_subst φ & ψ ¬(¬φ  ¬ψ))
2793       (auto simp: "oth-class-taut:5:a" "oth-class-taut:3:a")
2794  also AOT_have   ¬(¬φ  ¬ψ)
2795    by (AOT_subst ¬ψ ¬ψ)
2796       (auto simp: "KBasic2:1" "oth-class-taut:3:a")
2797  also AOT_have   ¬(¬φ  ¬ψ)
2798    using "KBasic:11" "≡E"(6) "oth-class-taut:3:a" by blast
2799  also AOT_have   ¬(¬φ  ¬ψ)
2800    using "S5Basic:9" "≡E"(1) "oth-class-taut:4:b" by blast
2801  also AOT_have   ¬(¬φ  ¬ψ)
2802    using "KBasic2:1"
2803    by (AOT_subst ¬φ ¬φ; AOT_subst ¬ψ ¬ψ)
2804       (auto simp:  "oth-class-taut:3:a")
2805  also AOT_have   φ & ψ
2806    using "≡E"(6) "oth-class-taut:3:a" "oth-class-taut:5:a" by blast
2807  finally show ?thesis .
2808qed
2809
2810AOT_theorem "S5Basic:12": (φ & ψ)  (φ & ψ)
2811proof (rule "≡I"; rule "→I")
2812  AOT_assume (φ & ψ)
2813  AOT_hence φ & ψ
2814    using "KBasic2:3" "vdash-properties:6" by blast
2815  AOT_thus φ & ψ
2816    using "5◇" "&I" "&E"(1) "&E"(2) "vdash-properties:6" by blast
2817next
2818  AOT_assume φ & ψ
2819  moreover AOT_have (ψ & φ)  (φ & ψ)
2820    by (AOT_subst φ & ψ ψ & φ)
2821       (auto simp: "Commutativity of &" "KBasic:16")
2822  ultimately AOT_show (φ & ψ)
2823    by (metis "4" "&I" "Conjunction Simplification"(1) "Conjunction Simplification"(2) "vdash-properties:6")
2824qed
2825
2826
2827AOT_theorem "S5Basic:13": (φ  ψ)  (φ  ψ)
2828proof (rule "≡I")
2829  AOT_modally_strict {
2830    AOT_have (φ  ψ)  (φ  ψ)
2831      by (meson "KBasic:13" "B◇" "Hypothetical Syllogism" "deduction-theorem")
2832  }
2833  AOT_hence (φ  ψ)  (φ  ψ)
2834    by (rule RM)
2835  AOT_thus  (φ  ψ)  (φ  ψ)
2836    using "4" "Hypothetical Syllogism" by blast
2837next
2838  AOT_modally_strict {
2839    AOT_have (φ  ψ)  (φ  ψ)
2840      by (meson "B" "Hypothetical Syllogism" "deduction-theorem" "qml:1" "vdash-properties:1[2]")
2841  }
2842  AOT_hence  (φ  ψ)  (φ  ψ)
2843    by (rule RM)
2844  AOT_thus (φ  ψ)  (φ  ψ)
2845    using "4" "Hypothetical Syllogism" by blast
2846qed
2847
2848AOT_theorem "derived-S5-rules:1":
2849  assumes Γ  φ  ψ shows Γ  φ  ψ
2850proof -
2851  AOT_have Γ  φ  ψ
2852    using assms by (rule "RM:1[prem]")
2853  AOT_thus Γ  φ  ψ
2854    using "B" "Hypothetical Syllogism" by blast
2855qed
2856
2857AOT_theorem "derived-S5-rules:2":
2858  assumes Γ  φ  ψ shows Γ  φ  ψ
2859proof -
2860  AOT_have Γ  φ  ψ
2861    using assms by (rule "RM:2[prem]")
2862  AOT_thus Γ  φ  ψ
2863    using "B◇" "Hypothetical Syllogism" by blast
2864qed
2865
2866AOT_theorem "BFs:1": α φ{α}  α φ{α}
2867proof -
2868  AOT_modally_strict {
2869    AOT_modally_strict {
2870      AOT_have α φ{α}  φ{α} for α by (fact AOT)
2871    }
2872    AOT_hence α φ{α}  φ{α} for α by (rule "RM◇")
2873    AOT_hence α φ{α}  α φ{α}
2874      using "B◇" "∀I" "→E" "→I" by metis
2875  }
2876  thus ?thesis using "derived-S5-rules:1" by blast
2877qed
2878lemmas "BF" = "BFs:1"
2879
2880AOT_theorem "BFs:2": α φ{α}  α φ{α}
2881proof -
2882  AOT_have α φ{α}  φ{α} for α using RM "cqt-orig:3" by metis
2883  thus ?thesis using  "cqt-orig:2"[THEN "→E"] "∀I" by metis
2884qed
2885lemmas "CBF" = "BFs:2"
2886
2887AOT_theorem "BFs:3": α φ{α}  α φ{α}
2888proof(rule "→I")
2889  AOT_modally_strict {
2890    AOT_have α ¬φ{α}  α ¬φ{α}
2891      using BF CBF "≡I" by blast
2892  } note θ = this
2893
2894  AOT_assume α φ{α}
2895  AOT_hence ¬¬(α φ{α})
2896    using "≡dfE" "conventions:5" by blast
2897  AOT_hence ¬α ¬φ{α}
2898    apply (AOT_subst α ¬φ{α} ¬(α φ{α}))
2899    using "≡dfI" "conventions:3" "conventions:4" "&I" "contraposition:2" "cqt-further:4"
2900          "df-rules-formulas[1]" "vdash-properties:1[2]" by blast
2901  AOT_hence ¬α ¬φ{α}
2902    apply (AOT_subst (reverse) α ¬φ{α} α ¬φ{α})
2903    using θ by blast
2904  AOT_hence ¬α ¬¬¬φ{α}
2905    apply - apply (AOT_subst_old_rev "λ τ. «¬φ{τ}»"  "λ τ. «¬¬¬φ{τ}»")
2906    by (simp add: "oth-class-taut:3:b")
2907  AOT_hence 0: α ¬¬φ{α}
2908    by (rule "conventions:4"[THEN "≡dfI"])
2909  AOT_show α φ{α}
2910    apply (AOT_subst_old "λ τ . «φ{τ}»" "λ τ . «¬¬φ{τ}»")
2911     apply (simp add: "conventions:5" "≡Df")
2912    using 0 by blast
2913qed
2914lemmas "BF◇" = "BFs:3"
2915
2916AOT_theorem "BFs:4": α φ{α}  α φ{α}
2917proof(rule "→I")
2918  AOT_assume α φ{α}
2919  AOT_hence ¬α ¬φ{α}
2920    using "conventions:4"[THEN "≡dfE"] by blast
2921  AOT_hence ¬α ¬φ{α}
2922    apply - apply (AOT_subst_old "λ τ . «¬φ{τ}»" "λ τ . «¬φ{τ}»")
2923    by (simp add: "KBasic2:1")
2924  moreover AOT_have α ¬φ{α}  α ¬φ{α}
2925    using "≡I" "BF" "CBF" by metis
2926  ultimately AOT_have 1: ¬α ¬φ{α}
2927    using "≡E"(3) by blast
2928  AOT_show α φ{α}
2929    apply (rule "conventions:5"[THEN "≡dfI"])
2930    apply (AOT_subst α φ{α} ¬α ¬φ{α})
2931     apply (simp add: "conventions:4" "≡Df")
2932    apply (AOT_subst ¬¬α ¬φ{α} α ¬φ{α})
2933    by (auto simp: 1 "≡I" "useful-tautologies:1" "useful-tautologies:2")
2934qed
2935lemmas "CBF◇" = "BFs:4"
2936
2937AOT_theorem "sign-S5-thm:1": α φ{α}  α φ{α}
2938proof(rule "→I")
2939  AOT_assume α φ{α}
2940  then AOT_obtain α where φ{α} using "∃E" by metis
2941  moreover AOT_have α
2942    by (simp add: "ex:1:a" "rule-ui:2[const_var]" RN)
2943  moreover AOT_have φ{τ}, τ  α φ{α} for τ
2944  proof -
2945    AOT_have φ{τ}, τ  α φ{α} using "existential:1" by blast
2946    AOT_thus φ{τ}, τ  α φ{α}
2947      using "RN[prem]"[where Γ="{φ τ, «τ»}", simplified] by blast
2948  qed
2949  ultimately AOT_show α φ{α} by blast
2950qed
2951lemmas Buridan = "sign-S5-thm:1"
2952
2953AOT_theorem "sign-S5-thm:2": α φ{α}  α φ{α}
2954proof -
2955  AOT_have α (α φ{α}  φ{α})
2956    by (simp add: "RM◇" "cqt-orig:3" "∀I")
2957  AOT_thus α φ{α}  α φ{α}
2958    using "∀E"(4) "∀I" "→E" "→I" by metis
2959qed
2960lemmas "Buridan◇" = "sign-S5-thm:2"
2961
2962AOT_theorem "sign-S5-thm:3": α (φ{α} & ψ{α})  (α φ{α} & α ψ{α})
2963  apply (rule "RM:2")
2964  by (metis (no_types, lifting) "instantiation" "&I" "&E"(1)
2965                                "&E"(2) "deduction-theorem" "existential:2[const_var]")
2966
2967AOT_theorem "sign-S5-thm:4": α (φ{α} & ψ{α})  α φ{α}
2968  apply (rule "RM:2")
2969  by (meson "instantiation" "&E"(1) "deduction-theorem" "existential:2[const_var]")
2970
2971AOT_theorem "sign-S5-thm:5": (α (φ{α}  ψ{α}) & α (ψ{α}  χ{α}))  α (φ{α}  χ{α})
2972proof -
2973  {
2974    fix φ' ψ' χ'
2975    AOT_assume  φ' & ψ'  χ'
2976    AOT_hence φ' & ψ'  χ'
2977      using "RN[prem]"[where Γ="{φ', ψ'}"] apply simp
2978      using "&E" "&I" "→E" "→I" by metis
2979  } note R = this
2980  show ?thesis by (rule R; fact AOT)
2981qed
2982
2983AOT_theorem "sign-S5-thm:6": (α (φ{α}  ψ{α}) & α(ψ{α}  χ{α}))  α(φ{α}  χ{α})
2984proof -
2985  {
2986    fix φ' ψ' χ'
2987    AOT_assume  φ' & ψ'  χ'
2988    AOT_hence φ' & ψ'  χ'
2989      using "RN[prem]"[where Γ="{φ', ψ'}"] apply simp
2990      using "&E" "&I" "→E" "→I" by metis
2991  } note R = this
2992  show ?thesis by (rule R; fact AOT)
2993qed
2994
2995AOT_theorem "exist-nec2:1": τ  τ
2996  using "B◇" "RM◇" "Hypothetical Syllogism" "exist-nec" by blast
2997
2998AOT_theorem "exists-nec2:2": τ  τ
2999  by (meson "Act-Sub:3" "Hypothetical Syllogism" "exist-nec" "exist-nec2:1" "≡I" "nec-imp-act")
3000
3001AOT_theorem "exists-nec2:3": ¬τ  ¬τ
3002  using "KBasic2:1" "deduction-theorem" "exist-nec2:1" "≡E"(2) "modus-tollens:1" by blast
3003
3004AOT_theorem "exists-nec2:4": ¬τ  ¬τ
3005  by (metis "Act-Sub:3" "KBasic:12" "deduction-theorem" "exist-nec" "exists-nec2:3" "≡I" "≡E"(4) "nec-imp-act" "reductio-aa:1")
3006
3007AOT_theorem "id-nec2:1": α = β  α = β
3008  using "B◇" "RM◇" "Hypothetical Syllogism" "id-nec:1" by blast
3009
3010AOT_theorem "id-nec2:2": α  β  α  β
3011  apply (AOT_subst_using subst: "=-infix"[THEN "≡Df"])
3012  using "KBasic2:1" "deduction-theorem" "id-nec2:1" "≡E"(2) "modus-tollens:1" by blast
3013
3014AOT_theorem "id-nec2:3": α  β  α  β
3015  apply (AOT_subst_using subst: "=-infix"[THEN "≡Df"])
3016  by (metis "KBasic:11" "deduction-theorem" "id-nec:2" "≡E"(3) "reductio-aa:2" "vdash-properties:6")
3017
3018AOT_theorem "id-nec2:4": α = β  α = β
3019  using "Hypothetical Syllogism" "id-nec2:1" "id-nec:1" by blast
3020
3021AOT_theorem "id-nec2:5": α  β  α  β
3022  using "id-nec2:3" "id-nec2:2" "→I" "→E" by metis
3023
3024AOT_theorem "sc-eq-box-box:1": (φ  φ)  (φ  φ)
3025  apply (rule "≡I"; rule "→I")
3026  using "KBasic:13" "5◇" "Hypothetical Syllogism" "vdash-properties:10" apply blast
3027  by (metis "KBasic2:1" "KBasic:1" "KBasic:2" "S5Basic:13" "≡E"(2) "raa-cor:5" "vdash-properties:6")
3028
3029AOT_theorem "sc-eq-box-box:2": ((φ  φ)  (φ  φ))  (φ  φ)
3030  by (metis "Act-Sub:3" "KBasic:13" "5◇" "∨E"(2) "deduction-theorem" "≡I" "nec-imp-act" "raa-cor:2" "vdash-properties:10")
3031
3032AOT_theorem "sc-eq-box-box:3": (φ  φ)  (¬φ  ¬φ)
3033proof (rule "→I"; rule "≡I"; rule "→I")
3034  AOT_assume (φ  φ)
3035  AOT_hence φ  φ using "sc-eq-box-box:1" "≡E" by blast
3036  moreover AOT_assume ¬φ
3037  ultimately AOT_have ¬φ
3038    using "modus-tollens:1" by blast
3039  AOT_thus ¬φ
3040    using "KBasic2:1" "≡E"(2) by blast
3041next
3042  AOT_assume (φ  φ)
3043  moreover AOT_assume ¬φ
3044  ultimately AOT_show ¬φ
3045    using "modus-tollens:1" "qml:2" "vdash-properties:10" "vdash-properties:1[2]" by blast
3046qed
3047
3048AOT_theorem "sc-eq-box-box:4": ((φ  φ) & (ψ  ψ))  ((φ  ψ)  (φ  ψ))
3049proof(rule "→I"; rule "→I")
3050  AOT_assume θ: (φ  φ) & (ψ  ψ)
3051  AOT_assume ξ: φ  ψ
3052  AOT_hence (φ & ψ)  (¬φ & ¬ψ)
3053    using "≡E"(4) "oth-class-taut:4:g" "raa-cor:3" by blast
3054  moreover {
3055    AOT_assume φ & ψ
3056    AOT_hence (φ  ψ)
3057      using "KBasic:3" "KBasic:8" "≡E"(2) "vdash-properties:10" by blast
3058  }
3059  moreover {
3060    AOT_assume ¬φ & ¬ψ
3061    moreover AOT_have ¬φ  ¬φ and ¬ψ  ¬ψ
3062      using θ "Conjunction Simplification"(1) "Conjunction Simplification"(2) "sc-eq-box-box:3" "vdash-properties:10" by metis+
3063    ultimately AOT_have ¬φ & ¬ψ
3064      by (metis "&I" "Conjunction Simplification"(1) "Conjunction Simplification"(2) "≡E"(4) "modus-tollens:1" "raa-cor:3")
3065    AOT_hence (φ  ψ)
3066      using "KBasic:3" "KBasic:9" "≡E"(2) "vdash-properties:10" by blast
3067  }
3068  ultimately AOT_show (φ  ψ)
3069    using "∨E"(2) "reductio-aa:1" by blast
3070qed
3071
3072AOT_theorem "sc-eq-box-box:5": ((φ  φ) & (ψ  ψ))  ((φ  ψ)  (φ  ψ))
3073proof (rule "→I")
3074  AOT_assume ((φ  φ) & (ψ  ψ))
3075  AOT_hence ((φ  φ) & (ψ  ψ))
3076    using 4[THEN "→E"] "&E" "&I" "KBasic:3" "≡E"(2) by metis
3077  moreover AOT_have ((φ  φ) & (ψ  ψ))  ((φ  ψ)  (φ  ψ))
3078  proof (rule RM; rule "→I"; rule "→I")
3079    AOT_modally_strict {
3080      AOT_assume A: ((φ  φ) & (ψ  ψ))
3081      AOT_hence φ  φ and ψ  ψ
3082        using "&E" "qml:2"[axiom_inst] "→E" by blast+
3083      moreover AOT_assume φ  ψ
3084      ultimately AOT_have φ  ψ
3085        using "→E" "qml:2"[axiom_inst] "≡E" "≡I" by meson
3086      moreover AOT_have (φ  ψ)  (φ  ψ)
3087        using A "sc-eq-box-box:4" "→E" by blast
3088      ultimately AOT_show (φ  ψ) using "→E" by blast
3089    }
3090  qed
3091  ultimately AOT_show ((φ  ψ)  (φ  ψ)) using "→E" by blast
3092qed
3093
3094AOT_theorem "sc-eq-box-box:6": (φ  φ)  ((φ  ψ)  (φ  ψ))
3095proof (rule "→I"; rule "→I"; rule "raa-cor:1")
3096  AOT_assume ¬(φ  ψ)
3097  AOT_hence ¬(φ  ψ) by (metis "KBasic:11" "≡E"(1))
3098  AOT_hence (φ & ¬ψ)
3099    by (AOT_subst φ & ¬ψ ¬(φ  ψ))
3100       (meson "Commutativity of ≡" "≡E"(1) "oth-class-taut:1:b")
3101  AOT_hence φ and 2: ¬ψ using "KBasic2:3"[THEN "→E"] "&E" by blast+
3102  moreover AOT_assume (φ  φ)
3103  ultimately AOT_have φ by (metis "≡E"(1) "sc-eq-box-box:1" "→E")
3104  AOT_hence φ using "qml:2"[axiom_inst, THEN "→E"] by blast
3105  moreover AOT_assume φ  ψ
3106  ultimately AOT_have ψ using "→E" by blast
3107  moreover AOT_have ¬ψ using 2 "KBasic:12" "¬¬I" "intro-elim:3:d" by blast
3108  ultimately AOT_show ψ & ¬ψ using "&I" by blast
3109qed
3110
3111AOT_theorem "sc-eq-box-box:7": (φ  φ)  ((φ  𝒜ψ)  𝒜(φ  ψ))
3112proof (rule "→I"; rule "→I"; rule "raa-cor:1")
3113  AOT_assume ¬𝒜(φ  ψ)
3114  AOT_hence 𝒜¬(φ  ψ) by (metis "Act-Basic:1" "∨E"(2))
3115  AOT_hence 𝒜(φ & ¬ψ)
3116    by (AOT_subst φ & ¬ψ ¬(φ  ψ))
3117       (meson "Commutativity of ≡" "≡E"(1) "oth-class-taut:1:b")
3118  AOT_hence 𝒜φ and 2: 𝒜¬ψ using "Act-Basic:2"[THEN "≡E"(1)] "&E" by blast+
3119  AOT_hence φ by (metis "Act-Sub:3" "→E")
3120  moreover AOT_assume (φ  φ)
3121  ultimately AOT_have φ by (metis "≡E"(1) "sc-eq-box-box:1" "→E")
3122  AOT_hence φ using "qml:2"[axiom_inst, THEN "→E"] by blast
3123  moreover AOT_assume φ  𝒜ψ
3124  ultimately AOT_have 𝒜ψ using "→E" by blast
3125  moreover AOT_have ¬𝒜ψ using 2 by (meson "Act-Sub:1" "≡E"(4) "raa-cor:3")
3126  ultimately AOT_show 𝒜ψ & ¬𝒜ψ using "&I" by blast
3127qed
3128
3129AOT_theorem "sc-eq-fur:1": 𝒜φ  𝒜φ
3130  using "Act-Basic:6" "Act-Sub:4" "≡E"(6) by blast
3131
3132AOT_theorem "sc-eq-fur:2": (φ  φ)  (𝒜φ  φ)
3133  by (metis "B◇" "Act-Sub:3" "KBasic:13" "T◇" "Hypothetical Syllogism" "deduction-theorem" "≡I" "nec-imp-act")
3134
3135AOT_theorem "sc-eq-fur:3": x (φ{x}  φ{x})  (∃!x φ{x}  ιx φ{x})
3136proof (rule "→I"; rule "→I")
3137  AOT_assume x (φ{x}  φ{x})
3138  AOT_hence A: x (φ{x}  φ{x}) using CBF "→E" by blast
3139  AOT_assume ∃!x φ{x}
3140  then AOT_obtain a where a_def: φ{a} & y (φ{y}  y = a)
3141    using "∃E"[rotated 1, OF "uniqueness:1"[THEN "≡dfE"]] by blast
3142  moreover AOT_have φ{a} using calculation A "∀E"(2) "qml:2"[axiom_inst] "→E" "&E"(1) by blast
3143  AOT_hence 𝒜φ{a} using "nec-imp-act" "vdash-properties:6" by blast
3144  moreover AOT_have y (𝒜φ{y}  y = a)
3145  proof (rule "∀I"; rule "→I")
3146    fix b
3147    AOT_assume 𝒜φ{b}
3148    AOT_hence φ{b}
3149      using "Act-Sub:3" "vdash-properties:6" by blast
3150    moreover {
3151      AOT_have (φ{b}  φ{b})
3152        using A "∀E"(2) by blast
3153      AOT_hence φ{b}  φ{b}
3154        using "KBasic:13" "5◇" "Hypothetical Syllogism" "vdash-properties:6" by blast
3155    }
3156    ultimately AOT_have φ{b} using "→E" by blast
3157    AOT_hence φ{b} using "qml:2"[axiom_inst] "→E" by blast
3158    AOT_thus b = a
3159      using a_def[THEN "&E"(2)] "∀E"(2) "→E" by blast
3160  qed
3161  ultimately AOT_have 𝒜φ{a} & y (𝒜φ{y}  y = a)
3162    using "&I" by blast
3163  AOT_hence x (𝒜φ{x} & y (𝒜φ{y}  y = x)) using "∃I" by fast
3164  AOT_hence ∃!x 𝒜φ{x} using "uniqueness:1"[THEN "≡dfI"] by fast
3165  AOT_thus ιx φ{x}
3166    using "actual-desc:1"[THEN "≡E"(2)] by blast
3167qed
3168
3169AOT_theorem "sc-eq-fur:4": x (φ{x}  φ{x})  (x = ιx φ{x}  (φ{x} & z (φ{z}  z = x)))
3170proof (rule "→I")
3171  AOT_assume x (φ{x}  φ{x})
3172  AOT_hence x (φ{x}  φ{x}) using CBF "→E" by blast
3173  AOT_hence A: 𝒜φ{α}  φ{α} for α using "sc-eq-fur:2" "∀E" "→E" by fast
3174  AOT_show x = ιx φ{x}  (φ{x} & z (φ{z}  z = x))
3175  proof (rule "≡I"; rule "→I")
3176    AOT_assume x = ιx φ{x}
3177    AOT_hence B: 𝒜φ{x} & z (𝒜φ{z}  z = x)
3178      using "nec-hintikka-scheme"[THEN "≡E"(1)] by blast
3179    AOT_show φ{x} & z (φ{z}  z = x)
3180    proof (rule "&I"; (rule "∀I"; rule "→I")?)
3181      AOT_show φ{x} using A B[THEN "&E"(1)] "≡E"(1) by blast
3182    next
3183      AOT_show z = x if φ{z} for z
3184        using that B[THEN "&E"(2)] "∀E"(2) "→E" A[THEN "≡E"(2)] by blast
3185    qed
3186  next
3187    AOT_assume B: φ{x} & z (φ{z}  z = x)
3188    AOT_have 𝒜φ{x} & z (𝒜φ{z}  z = x)
3189    proof(rule "&I"; (rule "∀I"; rule "→I")?)
3190      AOT_show 𝒜φ{x} using B[THEN "&E"(1)] A[THEN "≡E"(2)] by blast
3191    next
3192      AOT_show b = x if 𝒜φ{b} for b
3193        using that A[THEN "≡E"(1)] B[THEN "&E"(2), THEN "∀E"(2), THEN "→E"] by blast
3194    qed
3195    AOT_thus x = ιx φ{x}
3196      using "nec-hintikka-scheme"[THEN "≡E"(2)] by blast
3197  qed
3198qed
3199
3200AOT_theorem "id-act:1": α = β  𝒜α = β
3201  by (meson "Act-Sub:3" "Hypothetical Syllogism" "id-nec2:1" "id-nec:2" "≡I" "nec-imp-act")
3202
3203AOT_theorem "id-act:2": α  β  𝒜α  β
3204proof (AOT_subst α  β ¬(α = β))
3205  AOT_modally_strict {
3206    AOT_show α  β  ¬(α = β)
3207      by (simp add: "=-infix" "≡Df")
3208  }
3209next
3210  AOT_show ¬(α = β)  𝒜¬(α = β)
3211  proof (safe intro!: "≡I" "→I")
3212    AOT_assume ¬α = β
3213    AOT_hence ¬𝒜α = β using "id-act:1" "≡E"(3) by blast
3214    AOT_thus 𝒜¬α = β
3215      using "¬¬E" "Act-Sub:1" "≡E"(3) by blast
3216  next
3217    AOT_assume 𝒜¬α = β
3218    AOT_hence ¬𝒜α = β
3219      using "¬¬I" "Act-Sub:1" "≡E"(4) by blast
3220    AOT_thus ¬α = β
3221      using "id-act:1" "≡E"(4) by blast
3222  qed
3223qed
3224
3225AOT_theorem "A-Exists:1": 𝒜∃!α φ{α}  ∃!α 𝒜φ{α}
3226proof -
3227  AOT_have 𝒜∃!α φ{α}  𝒜αβ (φ{β}  β = α)
3228    by (AOT_subst_using subst: "uniqueness:2")
3229       (simp add: "oth-class-taut:3:a")
3230  also AOT_have   α 𝒜β (φ{β}  β = α)
3231    by (simp add: "Act-Basic:10")
3232  also AOT_have   αβ 𝒜(φ{β}  β = α)
3233    by (AOT_subst_old "λ τ . «𝒜β (φ{β}  β = τ)»" "λ τ . «β 𝒜(φ{β}  β = τ)»")
3234       (auto simp: "logic-actual-nec:3" "vdash-properties:1[2]" "oth-class-taut:3:a")
3235  also AOT_have   αβ (𝒜φ{β}  𝒜β = α)
3236    by (AOT_subst_old_rev "λ τ τ' . «𝒜(φ{τ'}  τ' = τ)»" "λ τ τ'. «𝒜φ{τ'}  𝒜τ' = τ»")
3237       (auto simp: "Act-Basic:5" "cqt-further:7")
3238  also AOT_have   αβ (𝒜φ{β}  β = α)
3239    apply (AOT_subst_old "λ τ τ' :: 'a . «𝒜τ' = τ»" "λ τ τ'. «τ' = τ»")
3240     apply (meson "id-act:1" "≡E"(6) "oth-class-taut:3:a")
3241    by (simp add: "cqt-further:7")
3242  also AOT_have ...  ∃!α 𝒜φ{α}
3243    using "uniqueness:2" "Commutativity of ≡"[THEN "≡E"(1)] by fast
3244  finally show ?thesis .
3245qed
3246
3247AOT_theorem "A-Exists:2": ιx φ{x}  𝒜∃!x φ{x}
3248  by (AOT_subst_using subst: "A-Exists:1")
3249     (simp add: "actual-desc:1")
3250
3251AOT_theorem "id-act-desc:1": ιx (x = y)
3252proof(rule "existence:1"[THEN "≡dfI"]; rule "∃I")
3253  AOT_show x E!x  E!x]ιx (x = y)
3254  proof (rule "russell-axiom[exe,1].nec-russell-axiom"[THEN "≡E"(2)]; rule "∃I"; (rule "&I")+)
3255    AOT_show 𝒜y = y by (simp add: "RA[2]" "id-eq:1")
3256  next
3257    AOT_show z (𝒜z = y  z = y)
3258      apply (rule "∀I")
3259      using "id-act:1"[THEN "≡E"(2)] "→I" by blast
3260  next
3261    AOT_show x E!x  E!x]y
3262    proof (rule "lambda-predicates:2"[axiom_inst, THEN "→E", THEN "≡E"(2)])
3263      AOT_show x E!x  E!x]
3264        by "cqt:2[lambda]"
3265    next
3266      AOT_show E!y  E!y 
3267        by (simp add: "if-p-then-p")
3268    qed
3269  qed
3270next
3271  AOT_show x E!x  E!x]
3272    by "cqt:2[lambda]"
3273qed
3274
3275AOT_theorem "id-act-desc:2": y = ιx (x = y)
3276  by (rule descriptions[axiom_inst, THEN "≡E"(2)]; rule "∀I"; rule "id-act:1"[symmetric])
3277
3278AOT_theorem "pre-en-eq:1[1]": x1[F]  x1[F]
3279  by (simp add: encoding "vdash-properties:1[2]")
3280
3281AOT_theorem "pre-en-eq:1[2]": x1x2[F]  x1x2[F]
3282proof (rule "→I")
3283  AOT_assume x1x2[F]
3284  AOT_hence x1y [F]yx2] and x2y [F]x1y]
3285    using "nary-encoding[2]"[axiom_inst, THEN "≡E"(1)] "&E" by blast+
3286  moreover AOT_have y [F]yx2] by "cqt:2[lambda]"
3287  moreover AOT_have y [F]x1y] by "cqt:2[lambda]"
3288  ultimately AOT_have x1y [F]yx2] and x2y [F]x1y]
3289    using encoding[axiom_inst, unvarify F] "→E" "&I" by blast+
3290  note A = this
3291  AOT_hence (x1y [F]yx2] & x2y [F]x1y])
3292    using "KBasic:3"[THEN "≡E"(2)] "&I" by blast
3293  AOT_thus x1x2[F]
3294    by (rule "nary-encoding[2]"[axiom_inst, THEN RN, THEN "KBasic:6"[THEN "→E"], THEN "≡E"(2)])
3295qed
3296
3297AOT_theorem "pre-en-eq:1[3]": x1x2x3[F]  x1x2x3[F]
3298proof (rule "→I")
3299  AOT_assume x1x2x3[F]
3300  AOT_hence x1y [F]yx2x3] and x2y [F]x1yx3] and x3y [F]x1x2y]
3301    using "nary-encoding[3]"[axiom_inst, THEN "≡E"(1)] "&E" by blast+
3302  moreover AOT_have y [F]yx2x3] by "cqt:2[lambda]"
3303  moreover AOT_have y [F]x1yx3] by "cqt:2[lambda]"
3304  moreover AOT_have y [F]x1x2y] by "cqt:2[lambda]"
3305  ultimately AOT_have x1y [F]yx2x3] and x2y [F]x1yx3] and x3y [F]x1x2y]
3306    using encoding[axiom_inst, unvarify F] "→E" by blast+
3307  note A = this
3308  AOT_have B: (x1y [F]yx2x3] & x2y [F]x1yx3] & x3y [F]x1x2y])
3309    by (rule "KBasic:3"[THEN "≡E"(2)] "&I" A)+
3310  AOT_thus x1x2x3[F]
3311    by (rule "nary-encoding[3]"[axiom_inst, THEN RN, THEN "KBasic:6"[THEN "→E"], THEN "≡E"(2)])
3312qed
3313
3314AOT_theorem "pre-en-eq:1[4]": x1x2x3x4[F]  x1x2x3x4[F]
3315proof (rule "→I")
3316  AOT_assume x1x2x3x4[F]
3317  AOT_hence x1y [F]yx2x3x4] and x2y [F]x1yx3x4] and x3y [F]x1x2yx4] and  x4y [F]x1x2x3y]
3318    using "nary-encoding[4]"[axiom_inst, THEN "≡E"(1)] "&E" by metis+
3319  moreover AOT_have y [F]yx2x3x4] by "cqt:2[lambda]"
3320  moreover AOT_have y [F]x1yx3x4] by "cqt:2[lambda]"
3321  moreover AOT_have y [F]x1x2yx4] by "cqt:2[lambda]"
3322  moreover AOT_have y [F]x1x2x3y] by "cqt:2[lambda]"
3323  ultimately AOT_have x1y [F]yx2x3x4] and x2y [F]x1yx3x4] and x3y [F]x1x2yx4] and x4y [F]x1x2x3y]
3324    using "→E" encoding[axiom_inst, unvarify F] by blast+
3325  note A = this
3326  AOT_have B: (x1y [F]yx2x3x4] & x2y [F]x1yx3x4] & x3y [F]x1x2yx4] & x4y [F]x1x2x3y])
3327    by (rule "KBasic:3"[THEN "≡E"(2)] "&I" A)+
3328  AOT_thus x1x2x3x4[F]
3329    by (rule "nary-encoding[4]"[axiom_inst, THEN RN, THEN "KBasic:6"[THEN "→E"], THEN "≡E"(2)])
3330qed
3331
3332AOT_theorem "pre-en-eq:2[1]": ¬x1[F]  ¬x1[F]
3333proof (rule "→I"; rule "raa-cor:1")
3334  AOT_assume ¬¬x1[F]
3335  AOT_hence x1[F]
3336    by (rule "conventions:5"[THEN "≡dfI"])
3337  AOT_hence x1[F]
3338    by(rule "S5Basic:13"[THEN "≡E"(1), OF  "pre-en-eq:1[1]"[THEN RN], THEN "qml:2"[axiom_inst, THEN "→E"], THEN "→E"])
3339  moreover AOT_assume ¬x1[F]
3340  ultimately AOT_show x1[F] & ¬x1[F] by (rule "&I")
3341qed
3342AOT_theorem "pre-en-eq:2[2]": ¬x1x2[F]  ¬x1x2[F]
3343proof (rule "→I"; rule "raa-cor:1")
3344  AOT_assume ¬¬x1x2[F]
3345  AOT_hence x1x2[F]
3346    by (rule "conventions:5"[THEN "≡dfI"])
3347  AOT_hence x1x2[F]
3348    by(rule "S5Basic:13"[THEN "≡E"(1), OF  "pre-en-eq:1[2]"[THEN RN], THEN "qml:2"[axiom_inst, THEN "→E"], THEN "→E"])
3349  moreover AOT_assume ¬x1x2[F]
3350  ultimately AOT_show x1x2[F] & ¬x1x2[F] by (rule "&I")
3351qed
3352
3353AOT_theorem "pre-en-eq:2[3]": ¬x1x2x3[F]  ¬x1x2x3[F]
3354proof (rule "→I"; rule "raa-cor:1")
3355  AOT_assume ¬¬x1x2x3[F]
3356  AOT_hence x1x2x3[F]
3357    by (rule "conventions:5"[THEN "≡dfI"])
3358  AOT_hence x1x2x3[F]
3359    by(rule "S5Basic:13"[THEN "≡E"(1), OF  "pre-en-eq:1[3]"[THEN RN], THEN "qml:2"[axiom_inst, THEN "→E"], THEN "→E"])
3360  moreover AOT_assume ¬x1x2x3[F]
3361  ultimately AOT_show x1x2x3[F] & ¬x1x2x3[F] by (rule "&I")
3362qed
3363
3364AOT_theorem "pre-en-eq:2[4]": ¬x1x2x3x4[F]  ¬x1x2x3x4[F]
3365proof (rule "→I"; rule "raa-cor:1")
3366  AOT_assume ¬¬x1x2x3x4[F]
3367  AOT_hence x1x2x3x4[F]
3368    by (rule "conventions:5"[THEN "≡dfI"])
3369  AOT_hence x1x2x3x4[F]
3370    by(rule "S5Basic:13"[THEN "≡E"(1), OF  "pre-en-eq:1[4]"[THEN RN], THEN "qml:2"[axiom_inst, THEN "→E"], THEN "→E"])
3371  moreover AOT_assume ¬x1x2x3x4[F]
3372  ultimately AOT_show x1x2x3x4[F] & ¬x1x2x3x4[F] by (rule "&I")
3373qed
3374
3375AOT_theorem "en-eq:1[1]": x1[F]  x1[F]
3376  using "pre-en-eq:1[1]"[THEN RN] "sc-eq-box-box:2" "∨I" "→E" by metis
3377AOT_theorem "en-eq:1[2]": x1x2[F]  x1x2[F]
3378  using "pre-en-eq:1[2]"[THEN RN] "sc-eq-box-box:2" "∨I" "→E" by metis
3379AOT_theorem "en-eq:1[3]": x1x2x3[F]  x1x2x3[F]
3380  using "pre-en-eq:1[3]"[THEN RN] "sc-eq-box-box:2" "∨I" "→E" by fast
3381AOT_theorem "en-eq:1[4]": x1x2x3x4[F]  x1x2x3x4[F]
3382  using "pre-en-eq:1[4]"[THEN RN] "sc-eq-box-box:2" "∨I" "→E" by fast
3383
3384AOT_theorem "en-eq:2[1]": x1[F]  x1[F]
3385  by (simp add: "≡I" "pre-en-eq:1[1]" "qml:2"[axiom_inst])
3386AOT_theorem "en-eq:2[2]": x1x2[F]  x1x2[F]
3387  by (simp add: "≡I" "pre-en-eq:1[2]" "qml:2"[axiom_inst])
3388AOT_theorem "en-eq:2[3]": x1x2x3[F]  x1x2x3[F]
3389  by (simp add: "≡I" "pre-en-eq:1[3]" "qml:2"[axiom_inst])
3390AOT_theorem "en-eq:2[4]": x1x2x3x4[F]  x1x2x3x4[F]
3391  by (simp add: "≡I" "pre-en-eq:1[4]" "qml:2"[axiom_inst])
3392
3393AOT_theorem "en-eq:3[1]": x1[F]  x1[F]
3394  using "T◇" "derived-S5-rules:2"[where Γ="{}", OF "pre-en-eq:1[1]"] "≡I" by blast
3395AOT_theorem "en-eq:3[2]": x1x2[F]  x1x2[F]
3396  using "T◇" "derived-S5-rules:2"[where Γ="{}", OF "pre-en-eq:1[2]"] "≡I" by blast
3397AOT_theorem "en-eq:3[3]": x1x2x3[F]  x1x2x3[F]
3398  using "T◇" "derived-S5-rules:2"[where Γ="{}", OF "pre-en-eq:1[3]"] "≡I" by blast
3399AOT_theorem "en-eq:3[4]": x1x2x3x4[F]  x1x2x3x4[F]
3400  using "T◇" "derived-S5-rules:2"[where Γ="{}", OF "pre-en-eq:1[4]"] "≡I" by blast
3401
3402AOT_theorem "en-eq:4[1]": (x1[F]  y1[G])  (x1[F]  y1[G])
3403  apply (rule "≡I"; rule "→I"; rule "≡I"; rule "→I")
3404  using "qml:2"[axiom_inst, THEN "→E"] "≡E"(1,2) "en-eq:2[1]" by blast+
3405AOT_theorem "en-eq:4[2]": (x1x2[F]  y1y2[G])  (x1x2[F]  y1y2[G])
3406  apply (rule "≡I"; rule "→I"; rule "≡I"; rule "→I")
3407  using "qml:2"[axiom_inst, THEN "→E"] "≡E"(1,2) "en-eq:2[2]" by blast+
3408AOT_theorem "en-eq:4[3]": (x1x2x3[F]  y1y2y3[G])  (x1x2x3[F]  y1y2y3[G])
3409  apply (rule "≡I"; rule "→I"; rule "≡I"; rule "→I")
3410  using "qml:2"[axiom_inst, THEN "→E"] "≡E"(1,2) "en-eq:2[3]" by blast+
3411AOT_theorem "en-eq:4[4]": (x1x2x3x4[F]  y1y2y3y4[G])  (x1x2x3x4[F]  y1y2y3y4[G])
3412  apply (rule "≡I"; rule "→I"; rule "≡I"; rule "→I")
3413  using "qml:2"[axiom_inst, THEN "→E"] "≡E"(1,2) "en-eq:2[4]" by blast+
3414
3415AOT_theorem "en-eq:5[1]": (x1[F]  y1[G])  (x1[F]  y1[G])
3416  apply (rule "≡I"; rule "→I")
3417  using "en-eq:4[1]"[THEN "≡E"(1)] "qml:2"[axiom_inst, THEN "→E"] apply blast
3418  using "sc-eq-box-box:4"[THEN "→E", THEN "→E"]
3419        "&I"[OF "pre-en-eq:1[1]"[THEN RN], OF "pre-en-eq:1[1]"[THEN RN]] by blast
3420AOT_theorem "en-eq:5[2]": (x1x2[F]  y1y2[G])  (x1x2[F]  y1y2[G])
3421  apply (rule "≡I"; rule "→I")
3422  using "en-eq:4[2]"[THEN "≡E"(1)] "qml:2"[axiom_inst, THEN "→E"] apply blast
3423  using "sc-eq-box-box:4"[THEN "→E", THEN "→E"]
3424        "&I"[OF "pre-en-eq:1[2]"[THEN RN], OF "pre-en-eq:1[2]"[THEN RN]] by blast
3425AOT_theorem "en-eq:5[3]": (x1x2x3[F]  y1y2y3[G])  (x1x2x3[F]  y1y2y3[G])
3426  apply (rule "≡I"; rule "→I")
3427  using "en-eq:4[3]"[THEN "≡E"(1)] "qml:2"[axiom_inst, THEN "→E"] apply blast
3428  using "sc-eq-box-box:4"[THEN "→E", THEN "→E"]
3429        "&I"[OF "pre-en-eq:1[3]"[THEN RN], OF "pre-en-eq:1[3]"[THEN RN]] by blast
3430AOT_theorem "en-eq:5[4]": (x1x2x3x4[F]  y1y2y3y4[G])  (x1x2x3x4[F]  y1y2y3y4[G])
3431  apply (rule "≡I"; rule "→I")
3432  using "en-eq:4[4]"[THEN "≡E"(1)] "qml:2"[axiom_inst, THEN "→E"] apply blast
3433  using "sc-eq-box-box:4"[THEN "→E", THEN "→E"]
3434        "&I"[OF "pre-en-eq:1[4]"[THEN RN], OF "pre-en-eq:1[4]"[THEN RN]] by blast
3435
3436AOT_theorem "en-eq:6[1]": (x1[F]  y1[G])  (x1[F]  y1[G])
3437  using "en-eq:5[1]"[symmetric] "en-eq:4[1]" "≡E"(5) by fast
3438AOT_theorem "en-eq:6[2]": (x1x2[F]  y1y2[G])  (x1x2[F]  y1y2[G])
3439  using "en-eq:5[2]"[symmetric] "en-eq:4[2]" "≡E"(5) by fast
3440AOT_theorem "en-eq:6[3]": (x1x2x3[F]  y1y2y3[G])  (x1x2x3[F]  y1y2y3[G])
3441  using "en-eq:5[3]"[symmetric] "en-eq:4[3]" "≡E"(5) by fast
3442AOT_theorem "en-eq:6[4]": (x1x2x3x4[F]  y1y2y3y4[G])  (x1x2x3x4[F]  y1y2y3y4[G])
3443  using "en-eq:5[4]"[symmetric] "en-eq:4[4]" "≡E"(5) by fast
3444
3445AOT_theorem "en-eq:7[1]": ¬x1[F]  ¬x1[F]
3446  using "pre-en-eq:2[1]" "qml:2"[axiom_inst] "≡I" by blast
3447AOT_theorem "en-eq:7[2]": ¬x1x2[F]  ¬x1x2[F]
3448  using "pre-en-eq:2[2]" "qml:2"[axiom_inst] "≡I" by blast
3449AOT_theorem "en-eq:7[3]": ¬x1x2x3[F]  ¬x1x2x3[F]
3450  using "pre-en-eq:2[3]" "qml:2"[axiom_inst] "≡I" by blast
3451AOT_theorem "en-eq:7[4]": ¬x1x2x3x4[F]  ¬x1x2x3x4[F]
3452  using "pre-en-eq:2[4]" "qml:2"[axiom_inst] "≡I" by blast
3453
3454AOT_theorem "en-eq:8[1]": ¬x1[F]  ¬x1[F]
3455  using "en-eq:2[1]"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "KBasic:11" "≡E"(5)[symmetric] by blast
3456AOT_theorem "en-eq:8[2]": ¬x1x2[F]  ¬x1x2[F]
3457  using "en-eq:2[2]"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "KBasic:11" "≡E"(5)[symmetric] by blast
3458AOT_theorem "en-eq:8[3]": ¬x1x2x3[F]  ¬x1x2x3[F]
3459  using "en-eq:2[3]"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "KBasic:11" "≡E"(5)[symmetric] by blast
3460AOT_theorem "en-eq:8[4]": ¬x1x2x3x4[F]  ¬x1x2x3x4[F]
3461  using "en-eq:2[4]"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "KBasic:11" "≡E"(5)[symmetric] by blast
3462
3463AOT_theorem "en-eq:9[1]": ¬x1[F]  ¬x1[F]
3464  using "en-eq:7[1]" "en-eq:8[1]" "≡E"(5) by blast
3465AOT_theorem "en-eq:9[2]": ¬x1x2[F]  ¬x1x2[F]
3466  using "en-eq:7[2]" "en-eq:8[2]" "≡E"(5) by blast
3467AOT_theorem "en-eq:9[3]": ¬x1x2x3[F]  ¬x1x2x3[F]
3468  using "en-eq:7[3]" "en-eq:8[3]" "≡E"(5) by blast
3469AOT_theorem "en-eq:9[4]": ¬x1x2x3x4[F]  ¬x1x2x3x4[F]
3470  using "en-eq:7[4]" "en-eq:8[4]" "≡E"(5) by blast
3471
3472AOT_theorem "en-eq:10[1]": 𝒜x1[F]  x1[F]
3473  by (metis "Act-Sub:3" "deduction-theorem" "≡I" "≡E"(1) "nec-imp-act" "en-eq:3[1]" "pre-en-eq:1[1]")
3474AOT_theorem "en-eq:10[2]": 𝒜x1x2[F]  x1x2[F]
3475  by (metis "Act-Sub:3" "deduction-theorem" "≡I" "≡E"(1) "nec-imp-act" "en-eq:3[2]" "pre-en-eq:1[2]")
3476AOT_theorem "en-eq:10[3]": 𝒜x1x2x3[F]  x1x2x3[F]
3477  by (metis "Act-Sub:3" "deduction-theorem" "≡I" "≡E"(1) "nec-imp-act" "en-eq:3[3]" "pre-en-eq:1[3]")
3478AOT_theorem "en-eq:10[4]": 𝒜x1x2x3x4[F]  x1x2x3x4[F]
3479  by (metis "Act-Sub:3" "deduction-theorem" "≡I" "≡E"(1) "nec-imp-act" "en-eq:3[4]" "pre-en-eq:1[4]")
3480
3481AOT_theorem "oa-facts:1": O!x  O!x
3482proof(rule "→I")
3483  AOT_modally_strict {
3484    AOT_have x E!x]x  E!x
3485      by (rule "lambda-predicates:2"[axiom_inst, THEN "→E"]) "cqt:2[lambda]"
3486  } note θ = this
3487  AOT_assume O!x
3488  AOT_hence x E!x]x
3489    by (rule "=dfE"(2)[OF AOT_ordinary, rotated 1]) "cqt:2[lambda]"
3490  AOT_hence E!x using θ[THEN "≡E"(1)] by blast
3491  AOT_hence 0: E!x using "qml:3"[axiom_inst, THEN "→E"] by blast
3492  AOT_have x E!x]x
3493    by (AOT_subst_using subst: θ) (simp add: 0)
3494  AOT_thus O!x
3495    by (rule "=dfI"(2)[OF AOT_ordinary, rotated 1]) "cqt:2[lambda]"
3496qed
3497
3498AOT_theorem "oa-facts:2": A!x  A!x
3499proof(rule "→I")
3500  AOT_modally_strict {
3501    AOT_have x ¬E!x]x  ¬E!x
3502      by (rule "lambda-predicates:2"[axiom_inst, THEN "→E"]) "cqt:2[lambda]"
3503  } note θ = this
3504  AOT_assume A!x
3505  AOT_hence x ¬E!x]x
3506    by (rule "=dfE"(2)[OF AOT_abstract, rotated 1]) "cqt:2[lambda]"
3507  AOT_hence ¬E!x using θ[THEN "≡E"(1)] by blast
3508  AOT_hence ¬E!x using "KBasic2:1"[THEN "≡E"(2)] by blast
3509  AOT_hence 0: ¬E!x using "4"[THEN "→E"] by blast
3510  AOT_have 1: ¬E!x
3511    apply (AOT_subst ¬E!x ¬E!x)
3512    using "KBasic2:1"[symmetric] apply blast
3513    using 0 by blast
3514  AOT_have x ¬E!x]x
3515    by (AOT_subst_using subst: θ) (simp add: 1)
3516  AOT_thus A!x
3517    by (rule "=dfI"(2)[OF AOT_abstract, rotated 1]) "cqt:2[lambda]"
3518qed
3519
3520AOT_theorem "oa-facts:3": O!x  O!x
3521  using "oa-facts:1" "B◇" "RM◇" "Hypothetical Syllogism" by blast
3522AOT_theorem "oa-facts:4": A!x  A!x
3523  using "oa-facts:2" "B◇" "RM◇" "Hypothetical Syllogism" by blast
3524
3525AOT_theorem "oa-facts:5": O!x  O!x
3526  by (meson "Act-Sub:3" "Hypothetical Syllogism" "≡I" "nec-imp-act" "oa-facts:1" "oa-facts:3")
3527
3528AOT_theorem "oa-facts:6": A!x  A!x
3529  by (meson "Act-Sub:3" "Hypothetical Syllogism" "≡I" "nec-imp-act" "oa-facts:2" "oa-facts:4")
3530
3531AOT_theorem "oa-facts:7": O!x  𝒜O!x
3532  by (meson "Act-Sub:3" "Hypothetical Syllogism" "≡I" "nec-imp-act" "oa-facts:1" "oa-facts:3")
3533
3534AOT_theorem "oa-facts:8": A!x  𝒜A!x
3535  by (meson "Act-Sub:3" "Hypothetical Syllogism" "≡I" "nec-imp-act" "oa-facts:2" "oa-facts:4")
3536
3537AOT_theorem "beta-C-meta": μ1...μn φ{μ1...μn, ν1...νn}]  (μ1...μn φ{μ1...μn, ν1...νn}]ν1...νn  φ{ν1...νn, ν1...νn})
3538  using "lambda-predicates:2"[axiom_inst] by blast
3539
3540AOT_theorem "beta-C-cor:1": (ν1...∀νn(μ1...μn φ{μ1...μn, ν1...νn}]))  ν1...∀νn (μ1...μn φ{μ1...μn, ν1...νn}]ν1...νn  φ{ν1...νn, ν1...νn})
3541  apply (rule "cqt-basic:14"[where 'a='a, THEN "→E"])
3542  using "beta-C-meta" "∀I" by fast
3543
3544AOT_theorem "beta-C-cor:2": μ1...μn φ{μ1...μn}]  ν1...∀νn (μ1...μn φ{μ1...μn}]ν1...νn  φ{ν1...νn})
3545  apply (rule "→I"; rule "∀I")
3546  using "beta-C-meta"[THEN "→E"] by fast
3547
3548(* TODO: syntax + double-check if this is really a faithful representation *)
3549theorem "beta-C-cor:3": assumes ν1νn. AOT_instance_of_cqt_2 (φ (AOT_term_of_var ν1νn))
3550  shows [v  ν1...∀νn (μ1...μn φ{ν1...νn,μ1...μn}]ν1...νn  φ{ν1...νn,ν1...νn})]
3551  using "cqt:2[lambda]"[axiom_inst, OF assms] "beta-C-cor:1"[THEN "→E"] "∀I" by fast
3552
3553AOT_theorem "betaC:1:a": μ1...μn φ{μ1...μn}]κ1...κn  φ{κ1...κn}
3554proof -
3555  AOT_modally_strict {
3556    AOT_assume μ1...μn φ{μ1...μn}]κ1...κn
3557    moreover AOT_have μ1...μn φ{μ1...μn}] and κ1...κn
3558      using calculation "cqt:5:a"[axiom_inst, THEN "→E"] "&E" by blast+
3559    ultimately AOT_show φ{κ1...κn}
3560      using "beta-C-cor:2"[THEN "→E", THEN "∀E"(1), THEN "≡E"(1)] by blast
3561  }
3562qed
3563
3564AOT_theorem "betaC:1:b": ¬φ{κ1...κn}  ¬μ1...μn φ{μ1...μn}]κ1...κn
3565  using "betaC:1:a" "raa-cor:3" by blast
3566
3567lemmas "β→C" = "betaC:1:a" "betaC:1:b"
3568
3569AOT_theorem "betaC:2:a": μ1...μn φ{μ1...μn}], κ1...κn, φ{κ1...κn}  μ1...μn φ{μ1...μn}]κ1...κn
3570proof -
3571  AOT_modally_strict {
3572    AOT_assume 1: μ1...μn φ{μ1...μn}] and 2: κ1...κn and 3: φ{κ1...κn}
3573    AOT_hence μ1...μn φ{μ1...μn}]κ1...κn
3574      using "beta-C-cor:2"[THEN "→E", OF 1, THEN "∀E"(1), THEN "≡E"(2)] by blast
3575  }
3576  AOT_thus μ1...μn φ{μ1...μn}], κ1...κn, φ{κ1...κn}  μ1...μn φ{μ1...μn}]κ1...κn
3577    by blast
3578qed
3579
3580AOT_theorem "betaC:2:b": μ1...μn φ{μ1...μn}], κ1...κn, ¬μ1...μn φ{μ1...μn}]κ1...κn  ¬φ{κ1...κn}
3581  using "betaC:2:a" "raa-cor:3" by blast
3582
3583lemmas "β←C" = "betaC:2:a" "betaC:2:b"
3584
3585AOT_theorem "eta-conversion-lemma1:1": Π  x1...xn [Π]x1...xn] = Π
3586  using "lambda-predicates:3"[axiom_inst] "∀I" "∀E"(1) "→I" by fast
3587
3588AOT_theorem "eta-conversion-lemma1:2": Π  ν1...νn [Π]ν1...νn] = Π
3589  using "eta-conversion-lemma1:1". (* TODO: spurious in the embedding *)
3590
3591(* match (τ) in "λa . ?b" ⇒ ‹match (τ') in "λa . ?b" ⇒ ‹fail›› ¦ _ ⇒ ‹ *)
3592
3593text‹Note: not explicitly part of PLM.›
3594AOT_theorem id_sym: assumes τ = τ' shows τ' = τ
3595  using "rule=E"[where φ="λ τ' . «τ' = τ»", rotated 1, OF assms]
3596        "=I"(1)[OF "t=t-proper:1"[THEN "→E", OF assms]] by auto
3597declare id_sym[sym]
3598
3599text‹Note: not explicitly part of PLM.›
3600AOT_theorem id_trans: assumes τ = τ' and τ' = τ'' shows τ = τ''
3601  using "rule=E" assms by blast
3602declare id_trans[trans]
3603
3604method "ηC" for Π :: <'a::{AOT_Term_id_2,AOT_κs}> = (match conclusion in "[v  τ{Π} = τ'{Π}]" for v τ τ'  3605rule "rule=E"[rotated 1, OF "eta-conversion-lemma1:2"[THEN "→E", of v "«[Π]»", symmetric]]
3606)
3607(*
3608AOT_theorem ‹[λy [λz [P]z]y → [λu [S]u]y] = [λy [P]y → [S]y]›
3609  apply ("ηC" "«[P]»") defer
3610   apply ("ηC" "«[S]»") defer
3611  oops
3612*)
3613(* TODO: proper representation of eta_conversion_lemma2 *)
3614
3615AOT_theorem "sub-des-lam:1": z1...zn  χ{z1...zn, ιx φ{x}}] & ιx φ{x} = ιx ψ{x}  z1...zn χ{z1...zn, ιx φ{x}}] = z1...zn χ{z1...zn, ιx ψ{x}}]
3616proof(rule "→I")
3617  AOT_assume A: z1...zn  χ{z1...zn, ιx φ{x}}] & ιx φ{x} = ιx ψ{x}
3618  AOT_show z1...zn χ{z1...zn, ιx φ{x}}] = z1...zn χ{z1...zn, ιx ψ{x}}]
3619    using "rule=E"[where φ="λ τ . «z1...zn χ{z1...zn, ιx φ{x}}] = z1...zn χ{z1...zn, τ}]»",
3620               OF "=I"(1)[OF A[THEN "&E"(1)]], OF A[THEN "&E"(2)]]
3621    by blast
3622qed
3623
3624AOT_theorem "sub-des-lam:2": ιx φ{x} = ιx ψ{x}  χ{ιx φ{x}} = χ{ιx ψ{x}} for χ :: ‹κ  𝗈›
3625  using "rule=E"[where φ="λ τ . «χ{ιx φ{x}} = χ{τ}»", OF "=I"(1)[OF "log-prop-prop:2"]] "→I" by blast
3626
3627AOT_theorem "prop-equiv": F = G  x (x[F]  x[G])
3628proof(rule "≡I"; rule "→I")
3629  AOT_assume F = G
3630  AOT_thus x (x[F]  x[G])
3631    by (rule "rule=E"[rotated]) (fact "oth-class-taut:3:a"[THEN GEN])
3632next
3633  AOT_assume x (x[F]  x[G])
3634  AOT_hence x[F]  x[G] for x using "∀E" by blast
3635  AOT_hence (x[F]  x[G]) for x using "en-eq:6[1]"[THEN "≡E"(1)] by blast
3636  AOT_hence x (x[F]  x[G]) by (rule GEN)
3637  AOT_hence x (x[F]  x[G]) using BF[THEN "→E"] by fast
3638  AOT_thus "F = G" using "p-identity-thm2:1"[THEN "≡E"(2)] by blast
3639qed
3640
3641AOT_theorem "relations:1":
3642  assumes INSTANCE_OF_CQT_2(φ)
3643  shows F x1...∀xn ([F]x1...xn  φ{x1...xn})
3644  apply (rule "∃I"(1)[where τ="«x1...xn φ{x1...xn}]»"])
3645  using "cqt:2[lambda]"[OF assms, axiom_inst] "beta-C-cor:2"[THEN "→E", THEN RN] by blast+
3646
3647AOT_theorem "relations:2":
3648  assumes INSTANCE_OF_CQT_2(φ)
3649  shows F x ([F]x  φ{x})
3650  using "relations:1" assms by blast
3651
3652AOT_theorem "block-paradox:1": ¬x G (x[G] & ¬[G]x)]
3653proof(rule RAA(2))
3654  let ="λ τ. «G (τ[G] & ¬[G]τ)»"
3655  AOT_assume A: x « x»]
3656  AOT_have x (A!x & F (x[F]  F = x « x»]))
3657    using "A-objects"[axiom_inst] by fast
3658  then AOT_obtain a where ξ: A!a & F (a[F]  F = x « x»])
3659    using "∃E"[rotated] by blast
3660  AOT_show ¬x G (x[G] & ¬[G]x)]
3661  proof (rule "∨E"(1)[OF "exc-mid"]; rule "→I")
3662    AOT_assume B: x « x»]a
3663    AOT_hence G (a[G] & ¬[G]a) using "β→C" A by blast
3664    then AOT_obtain P where a[P] & ¬[P]a using "∃E"[rotated] by blast
3665    moreover AOT_have P = x « x»]
3666      using ξ[THEN "&E"(2), THEN "∀E"(2), THEN "≡E"(1)] calculation[THEN "&E"(1)] by blast
3667    ultimately AOT_have ¬x « x»]a
3668      using "rule=E" "&E"(2) by fast
3669    AOT_thus ¬x G (x[G] & ¬[G]x)] using B RAA by blast
3670  next
3671    AOT_assume B: ¬x « x»]a
3672    AOT_hence ¬G (a[G] & ¬[G]a) using "β←C" "cqt:2[const_var]"[of a, axiom_inst] A by blast
3673    AOT_hence C: G ¬(a[G] & ¬[G]a) using "cqt-further:4"[THEN "→E"] by blast
3674    AOT_have G (a[G]  [G]a)
3675      by (AOT_subst_old "λ Π . «a[Π]  [Π]a»" "λ Π . «¬(a[Π] & ¬[Π]a)»")
3676         (auto simp: "oth-class-taut:1:a" C)
3677    AOT_hence ax « x»]  x « x»]a using "∀E" A by blast
3678    moreover AOT_have ax « x»] using ξ[THEN "&E"(2), THEN "∀E"(1), OF A, THEN "≡E"(2)]
3679      using "=I"(1)[OF A] by blast
3680    ultimately AOT_show ¬x G (x[G] & ¬[G]x)] using B "→E" RAA by blast
3681  qed
3682qed(simp)
3683
3684AOT_theorem "block-paradox:2": ¬F x([F]x  G(x[G] & ¬[G]x))
3685proof(rule RAA(2))
3686  AOT_assume F x ([F]x  G (x[G] & ¬[G]x))
3687  then AOT_obtain F where F_prop: x ([F]x  G (x[G] & ¬[G]x)) using "∃E"[rotated] by blast
3688  AOT_have x (A!x & G (x[G]  G = F))
3689    using "A-objects"[axiom_inst] by fast
3690  then AOT_obtain a where ξ: A!a & G (a[G]  G = F)
3691    using "∃E"[rotated] by blast
3692  AOT_show ¬F x([F]x  G(x[G] & ¬[G]x))
3693  proof (rule "∨E"(1)[OF "exc-mid"]; rule "→I")
3694    AOT_assume B: [F]a
3695    AOT_hence G (a[G] & ¬[G]a) using F_prop[THEN "∀E"(2), THEN "≡E"(1)] by blast
3696    then AOT_obtain P where a[P] & ¬[P]a using "∃E"[rotated] by blast
3697    moreover AOT_have P = F
3698      using ξ[THEN "&E"(2), THEN "∀E"(2), THEN "≡E"(1)] calculation[THEN "&E"(1)] by blast
3699    ultimately AOT_have ¬[F]a
3700      using "rule=E" "&E"(2) by fast
3701    AOT_thus ¬F x([F]x  G(x[G] & ¬[G]x)) using B RAA by blast
3702  next
3703    AOT_assume B: ¬[F]a
3704    AOT_hence ¬G (a[G] & ¬[G]a)
3705      using "oth-class-taut:4:b"[THEN "≡E"(1), OF F_prop[THEN "∀E"(2)[of _ _ a]], THEN "≡E"(1)] by simp
3706    AOT_hence C: G ¬(a[G] & ¬[G]a) using "cqt-further:4"[THEN "→E"] by blast
3707    AOT_have G (a[G]  [G]a)
3708      by (AOT_subst_old "λ Π . «a[Π]  [Π]a»" "λ Π . «¬(a[Π] & ¬[Π]a)»")
3709         (auto simp: "oth-class-taut:1:a" C)
3710    AOT_hence a[F]  [F]a using "∀E" by blast
3711    moreover AOT_have a[F] using ξ[THEN "&E"(2), THEN "∀E"(2), of F, THEN "≡E"(2)]
3712      using "=I"(2) by blast
3713    ultimately AOT_show ¬F x([F]x  G(x[G] & ¬[G]x)) using B "→E" RAA by blast
3714  qed
3715qed(simp)
3716
3717AOT_theorem "block-paradox:3": ¬y z z = y]
3718proof(rule RAA(2))
3719  AOT_assume θ: y z z = y]
3720  AOT_have x (A!x & F (x[F]  y(F = z z = y] & ¬y[F])))
3721    using "A-objects"[axiom_inst] by force
3722  then AOT_obtain a where a_prop: A!a & F (a[F]  y (F = z z = y] & ¬y[F]))
3723    using "∃E"[rotated] by blast
3724  AOT_have ζ: az z = a]  y (z z = a] = z z = y] & ¬yz z = a])
3725    using θ[THEN "∀E"(2)] a_prop[THEN "&E"(2), THEN "∀E"(1)] by blast
3726  AOT_show ¬y z z = y]
3727  proof (rule "∨E"(1)[OF "exc-mid"]; rule "→I")
3728    AOT_assume A: az z = a]
3729    AOT_hence y (z z = a] = z z = y] & ¬yz z = a])
3730      using ζ[THEN "≡E"(1)] by blast
3731    then AOT_obtain b where b_prop: z z = a] = z z = b] & ¬bz z = a]
3732      using "∃E"[rotated] by blast
3733    moreover AOT_have a = a by (rule "=I")
3734    moreover AOT_have z z = a] using θ "∀E" by blast
3735    moreover AOT_have a using "cqt:2[const_var]"[axiom_inst] .
3736    ultimately AOT_have z z = a]a using "β←C" by blast
3737    AOT_hence z z = b]a using "rule=E" b_prop[THEN "&E"(1)] by fast
3738    AOT_hence a = b using "β→C" by blast
3739    AOT_hence bz z = a] using A "rule=E" by fast
3740    AOT_thus ¬y z z = y] using b_prop[THEN "&E"(2)] RAA by blast
3741  next
3742    AOT_assume A: ¬az z = a]
3743    AOT_hence ¬y (z z = a] = z z = y] & ¬yz z = a])
3744      using ζ "oth-class-taut:4:b"[THEN "≡E"(1), THEN "≡E"(1)] by blast
3745    AOT_hence y ¬(z z = a] = z z = y] & ¬yz z = a])
3746      using "cqt-further:4"[THEN "→E"] by blast
3747    AOT_hence ¬(z z = a] = z z = a] & ¬az z = a])
3748      using "∀E" by blast
3749    AOT_hence z z = a] = z z = a]  az z = a]
3750      by (metis "&I" "deduction-theorem" "raa-cor:4")
3751    AOT_hence az z = a] using "=I"(1) θ[THEN "∀E"(2)] "→E" by blast
3752    AOT_thus ¬y z z = y] using A RAA by blast
3753  qed
3754qed(simp)
3755
3756AOT_theorem "block-paradox:4": ¬y F x([F]x  x = y)
3757proof(rule RAA(2))
3758  AOT_assume θ: y F x([F]x  x = y)
3759  AOT_have x (A!x & F (x[F]  z (y([F]y  y = z) & ¬z[F])))
3760    using "A-objects"[axiom_inst] by force
3761  then AOT_obtain a where a_prop: A!a & F (a[F]  z (y([F]y  y = z) & ¬z[F]))
3762    using "∃E"[rotated] by blast
3763  AOT_obtain F where F_prop: x ([F]x  x = a) using θ[THEN "∀E"(2)] "∃E"[rotated] by blast
3764  AOT_have ζ: a[F]  z (y ([F]y  y = z) & ¬z[F])
3765    using a_prop[THEN "&E"(2), THEN "∀E"(2)] by blast
3766  AOT_show ¬y F x([F]x  x = y)
3767  proof (rule "∨E"(1)[OF "exc-mid"]; rule "→I")
3768    AOT_assume A: a[F]
3769    AOT_hence z (y ([F]y  y = z) & ¬z[F])
3770      using ζ[THEN "≡E"(1)] by blast
3771    then AOT_obtain b where b_prop: y ([F]y  y = b) & ¬b[F]
3772      using "∃E"[rotated] by blast
3773    moreover AOT_have [F]a using F_prop[THEN "∀E"(2), THEN "≡E"(2)] "=I"(2) by blast
3774    ultimately AOT_have a = b using "∀E"(2) "≡E"(1) "&E" by fast
3775    AOT_hence a = b using "β→C" by blast
3776    AOT_hence b[F] using A "rule=E" by fast
3777    AOT_thus ¬y F x([F]x  x = y) using b_prop[THEN "&E"(2)] RAA by blast
3778  next
3779    AOT_assume A: ¬a[F]
3780    AOT_hence ¬z (y ([F]y  y = z) & ¬z[F])
3781      using ζ "oth-class-taut:4:b"[THEN "≡E"(1), THEN "≡E"(1)] by blast
3782    AOT_hence z ¬(y ([F]y  y = z) & ¬z[F])
3783      using "cqt-further:4"[THEN "→E"] by blast
3784    AOT_hence ¬(y ([F]y  y = a) & ¬a[F])
3785      using "∀E" by blast
3786    AOT_hence y ([F]y  y = a)  a[F]
3787      by (metis "&I" "deduction-theorem" "raa-cor:4")
3788    AOT_hence a[F] using F_prop "→E" by blast
3789    AOT_thus ¬y F x([F]x  x = y) using A RAA by blast
3790  qed
3791qed(simp)
3792
3793AOT_theorem "block-paradox:5": ¬Fxy([F]xy  y = x)
3794proof(rule "raa-cor:2")
3795  AOT_assume Fxy([F]xy  y = x)
3796  then AOT_obtain F where F_prop: xy([F]xy  y = x) using "∃E"[rotated] by blast
3797  {
3798    fix x
3799    AOT_have 1: y([F]xy  y = x) using F_prop "∀E" by blast
3800    AOT_have 2: z [F]xz] by "cqt:2[lambda]"
3801    moreover AOT_have y(z [F]xz]y  y = x)
3802    proof(rule "∀I")
3803      fix y
3804      AOT_have z [F]xz]y  [F]xy
3805        using "beta-C-meta"[THEN "→E"] 2 by fast
3806      also AOT_have ...  y = x using 1 "∀E"
3807        by fast
3808      finally AOT_show z [F]xz]y  y = x.
3809    qed
3810    ultimately AOT_have Fy([F]y  y = x)
3811      using "∃I" by fast
3812  }
3813  AOT_hence xFy([F]y  y = x)
3814    by (rule GEN)
3815  AOT_thus xFy([F]y  y = x) & ¬xFy([F]y  y = x)
3816    using "&I" "block-paradox:4" by blast
3817qed
3818
3819AOT_act_theorem "block-paradox2:1": x [G]x  ¬x [G]ιy (y = x & H (x[H] & ¬[H]x))]
3820proof(rule "→I"; rule "raa-cor:2")
3821  AOT_assume antecedant: x [G]x
3822  AOT_have Lemma: x ([G]ιy(y = x & H (x[H] & ¬[H]x))  H (x[H] & ¬[H]x))
3823  proof(rule GEN)
3824    fix x
3825    AOT_have A: [G]ιy (y = x & H (x[H] & ¬[H]x))  ∃!y (y = x & H (x[H] & ¬[H]x))
3826    proof(rule "≡I"; rule "→I")
3827      AOT_assume [G]ιy (y = x & H (x[H] & ¬[H]x))
3828      AOT_hence ιy (y = x & H (x[H] & ¬[H]x))
3829        using "cqt:5:a"[axiom_inst, THEN "→E", THEN "&E"(2)] by blast
3830      AOT_thus ∃!y (y = x & H (x[H] & ¬[H]x))
3831        using "1-exists:1"[THEN "≡E"(1)] by blast
3832    next
3833      AOT_assume A: ∃!y (y = x & H (x[H] & ¬[H]x))
3834      AOT_obtain a where a_1: a = x & H (x[H] & ¬[H]x) and a_2: z (z = x & H (x[H] & ¬[H]x)  z = a)
3835        using "uniqueness:1"[THEN "≡dfE", OF A] "&E" "∃E"[rotated] by blast
3836      AOT_have a_3: [G]a
3837        using antecedant "∀E" by blast
3838      AOT_show [G]ιy (y = x & H (x[H] & ¬[H]x))
3839        apply (rule "russell-axiom[exe,1].russell-axiom"[THEN "≡E"(2)])
3840        apply (rule "∃I"(2))
3841        using a_1 a_2 a_3 "&I" by blast
3842    qed
3843    also AOT_have B: ...  H (x[H] & ¬[H]x)
3844    proof (rule "≡I"; rule "→I")
3845      AOT_assume A: ∃!y (y = x & H (x[H] & ¬[H]x))
3846      AOT_obtain a where a = x & H (x[H] & ¬[H]x)
3847        using "uniqueness:1"[THEN "≡dfE", OF A] "&E" "∃E"[rotated] by blast
3848      AOT_thus H (x[H] & ¬[H]x) using "&E" by blast
3849    next
3850      AOT_assume H (x[H] & ¬[H]x)
3851      AOT_hence x = x & H (x[H] & ¬[H]x)
3852        using "id-eq:1" "&I" by blast
3853      moreover AOT_have z (z = x & H (x[H] & ¬[H]x)  z = x)
3854        by (simp add: "Conjunction Simplification"(1) "universal-cor")
3855      ultimately AOT_show ∃!y (y = x & H (x[H] & ¬[H]x))
3856        using "uniqueness:1"[THEN "≡dfI"] "&I" "∃I"(2) by fast
3857    qed
3858    finally AOT_show ([G]ιy(y = x & H (x[H] & ¬[H]x))  H (x[H] & ¬[H]x)) .
3859  qed
3860
3861  AOT_assume A: x [G]ιy (y = x & H (x[H] & ¬[H]x))]
3862  AOT_have θ: x (x [G]ιy (y = x & H (x[H] & ¬[H]x))]x  [G]ιy(y = x & H (x[H] & ¬[H]x)))
3863    using "beta-C-meta"[THEN "→E", OF A] "∀I" by fast
3864  AOT_have x (x [G]ιy (y = x & H (x[H] & ¬[H]x))]x  H (x[H] & ¬[H]x))
3865    using θ Lemma "cqt-basic:10"[THEN "→E"] "&I" by fast
3866  AOT_hence F x ([F]x  H (x[H] & ¬[H]x))
3867    using "∃I"(1) A by fast
3868  AOT_thus (F x ([F]x  H (x[H] & ¬[H]x))) & (¬F x ([F]x  H (x[H] & ¬[H]x)))
3869    using "block-paradox:2" "&I" by blast
3870qed
3871
3872AOT_act_theorem "block-paradox2:2": G ¬x [G]ιy (y = x & H (x[H] & ¬[H]x))]
3873proof(rule "∃I"(1))
3874  AOT_have 0: x p (p p)]
3875    by "cqt:2[lambda]"
3876  moreover AOT_have x x p (p p)]x
3877    apply (rule GEN)
3878    apply (rule "beta-C-cor:2"[THEN "→E", OF 0, THEN "∀E"(2), THEN "≡E"(2)])
3879    using "if-p-then-p" GEN by fast
3880  moreover AOT_have G (x [G]x  ¬x [G]ιy (y = x & H (x[H] & ¬[H]x))])
3881      using "block-paradox2:1" "∀I" by fast
3882  ultimately AOT_show ¬x x p (p p)]ιy (y = x & H (x[H] & ¬[H]x))]
3883    using "∀E"(1) "→E" by blast
3884qed("cqt:2[lambda]")
3885
3886AOT_theorem propositions: p (p  φ)
3887proof(rule "∃I"(1))
3888  AOT_show (φ  φ)
3889    by (simp add: RN "oth-class-taut:3:a")
3890next
3891  AOT_show φ
3892    by (simp add: "log-prop-prop:2")
3893qed
3894
3895AOT_theorem "pos-not-equiv-ne:1": (¬x1...∀xn ([F]x1...xn  [G]x1...xn))  F  G
3896proof (rule "→I")
3897  AOT_assume ¬x1...∀xn ([F]x1...xn  [G]x1...xn)
3898  AOT_hence ¬x1...∀xn ([F]x1...xn  [G]x1...xn)
3899    using "KBasic:11"[THEN "≡E"(2)] by blast
3900  AOT_hence ¬(F = G)
3901    using "id-rel-nec-equiv:1" "modus-tollens:1" by blast
3902  AOT_thus F  G
3903    using "=-infix"[THEN "≡dfI"] by blast
3904qed
3905
3906AOT_theorem "pos-not-equiv-ne:2": (¬(φ{F}  φ{G}))  F  G
3907proof (rule "→I")
3908  AOT_modally_strict {
3909    AOT_have ¬(φ{F}  φ{G})  ¬(F = G)
3910    proof (rule "→I"; rule "raa-cor:2")
3911      AOT_assume 1: F = G
3912      AOT_hence φ{F}  φ{G} using "l-identity"[axiom_inst, THEN "→E"] by blast
3913      moreover {
3914        AOT_have G = F using 1 id_sym by blast
3915        AOT_hence φ{G}  φ{F} using "l-identity"[axiom_inst, THEN "→E"] by blast
3916      }
3917      ultimately AOT_have φ{F}  φ{G} using "≡I" by blast
3918      moreover AOT_assume ¬(φ{F}  φ{G})
3919      ultimately AOT_show (φ{F}  φ{G}) & ¬(φ{F}  φ{G})
3920        using "&I" by blast
3921    qed
3922  }
3923  AOT_hence ¬(φ{F}  φ{G})  ¬(F = G)
3924    using "RM:2[prem]" by blast
3925  moreover AOT_assume ¬(φ{F}  φ{G})
3926  ultimately AOT_have 0: ¬(F = G) using "→E" by blast
3927  AOT_have (F  G)
3928    by (AOT_subst F  G ¬(F = G))
3929       (auto simp: "=-infix" "≡Df" 0)
3930  AOT_thus F  G
3931    using "id-nec2:3"[THEN "→E"] by blast
3932qed
3933
3934AOT_theorem "pos-not-equiv-ne:2[zero]": (¬(φ{p}  φ{q}))  p  q
3935proof (rule "→I")
3936  AOT_modally_strict {
3937    AOT_have ¬(φ{p}  φ{q})  ¬(p = q)
3938    proof (rule "→I"; rule "raa-cor:2")
3939      AOT_assume 1: p = q
3940      AOT_hence φ{p}  φ{q} using "l-identity"[axiom_inst, THEN "→E"] by blast
3941      moreover {
3942        AOT_have q = p using 1 id_sym by blast
3943        AOT_hence φ{q}  φ{p} using "l-identity"[axiom_inst, THEN "→E"] by blast
3944      }
3945      ultimately AOT_have φ{p}  φ{q} using "≡I" by blast
3946      moreover AOT_assume ¬(φ{p}  φ{q})
3947      ultimately AOT_show (φ{p}  φ{q}) & ¬(φ{p}  φ{q})
3948        using "&I" by blast
3949    qed
3950  }
3951  AOT_hence ¬(φ{p}  φ{q})  ¬(p = q)
3952    using "RM:2[prem]" by blast
3953  moreover AOT_assume ¬(φ{p}  φ{q})
3954  ultimately AOT_have 0: ¬(p = q) using "→E" by blast
3955  AOT_have (p  q)
3956    by (AOT_subst p  q ¬(p = q))
3957       (auto simp: 0 "=-infix" "≡Df")
3958  AOT_thus p  q
3959    using "id-nec2:3"[THEN "→E"] by blast
3960qed
3961
3962AOT_theorem "pos-not-equiv-ne:3": (¬x1...∀xn ([F]x1...xn  [G]x1...xn))  F  G
3963  using "→I" "pos-not-equiv-ne:1"[THEN "→E"] "T◇"[THEN "→E"] by blast
3964
3965AOT_theorem "pos-not-equiv-ne:4": (¬(φ{F}  φ{G}))  F  G
3966  using "→I" "pos-not-equiv-ne:2"[THEN "→E"] "T◇"[THEN "→E"] by blast
3967
3968AOT_theorem "pos-not-equiv-ne:4[zero]": (¬(φ{p}  φ{q}))  p  q
3969  using "→I" "pos-not-equiv-ne:2[zero]"[THEN "→E"] "T◇"[THEN "→E"] by blast
3970
3971AOT_define relation_negation ::  Π" ("_-")
3972  "df-relation-negation": "[F]- =df x1...xn ¬[F]x1...xn]"
3973
3974nonterminal φneg
3975syntax "" :: "φneg  τ" ("_")
3976syntax "" :: "φneg  φ" ("'(_')")
3977
3978AOT_define relation_negation_0 :: ‹φ  φneg› ("'(_')-")
3979  "df-relation-negation[zero]": "(p)- =df  ¬p]"
3980
3981AOT_theorem "rel-neg-T:1": x1...xn ¬[Π]x1...xn]
3982  by "cqt:2[lambda]"
3983
3984AOT_theorem "rel-neg-T:1[zero]":  ¬φ]
3985  using "cqt:2[lambda0]"[axiom_inst] by blast
3986
3987AOT_theorem "rel-neg-T:2": [Π]- = x1...xn ¬[Π]x1...xn]
3988  using "=I"(1)[OF "rel-neg-T:1"]
3989  by (rule "=dfI"(1)[OF "df-relation-negation", OF "rel-neg-T:1"])
3990
3991AOT_theorem "rel-neg-T:2[zero]": (φ)- =  ¬φ]
3992  using "=I"(1)[OF "rel-neg-T:1[zero]"]
3993  by (rule "=dfI"(1)[OF "df-relation-negation[zero]", OF "rel-neg-T:1[zero]"])
3994
3995AOT_theorem "rel-neg-T:3": [Π]-
3996  using "=dfI"(1)[OF "df-relation-negation", OF "rel-neg-T:1"] "rel-neg-T:1" by blast
3997
3998AOT_theorem "rel-neg-T:3[zero]": (φ)-
3999  using "log-prop-prop:2" by blast
4000(*  using "=dfI"(1)[OF "df-relation-negation[zero]", OF "rel-neg-T:1[zero]"] "rel-neg-T:1[zero]" by blast *)
4001
4002(* Note: PLM states the zero place case twice *)
4003AOT_theorem "thm-relation-negation:1": [F]-x1...xn  ¬[F]x1...xn
4004proof -
4005  AOT_have [F]-x1...xn  x1...xn ¬[F]x1...xn]x1...xn
4006    using "rule=E"[rotated, OF "rel-neg-T:2"] "rule=E"[rotated, OF "rel-neg-T:2"[THEN id_sym]]
4007    "→I" "≡I" by fast
4008  also AOT_have ...  ¬[F]x1...xn
4009    using "beta-C-meta"[THEN "→E", OF "rel-neg-T:1"] by fast
4010  finally show ?thesis.
4011qed
4012
4013AOT_theorem "thm-relation-negation:2": ¬[F]-x1...xn  [F]x1...xn
4014  apply (AOT_subst [F]x1...xn ¬¬[F]x1...xn)
4015   apply (simp add: "oth-class-taut:3:b")
4016  apply (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
4017  using "thm-relation-negation:1".
4018
4019AOT_theorem "thm-relation-negation:3": ((p)-)  ¬p
4020proof -
4021  AOT_have (p)- =  ¬p] using "rel-neg-T:2[zero]" by blast
4022  AOT_hence ((p)-)   ¬p]
4023    using "df-relation-negation[zero]" "log-prop-prop:2" "oth-class-taut:3:a" "rule-id-df:2:a" by blast
4024  also AOT_have  ¬p]  ¬p
4025    by (simp add: "propositions-lemma:2")
4026  finally show ?thesis.
4027qed
4028
4029AOT_theorem "thm-relation-negation:4": (¬((p)-))  p
4030  using "thm-relation-negation:3"[THEN "≡E"(1)]
4031        "thm-relation-negation:3"[THEN "≡E"(2)]
4032        "≡I" "→I" RAA by metis
4033
4034AOT_theorem "thm-relation-negation:5": [F]  [F]-
4035proof -
4036  AOT_have ¬([F] = [F]-)
4037  proof (rule RAA(2))
4038    AOT_show [F]x1...xn  [F]x1...xn for x1xn
4039      using "if-p-then-p".
4040  next
4041    AOT_assume [F] = [F]-
4042    AOT_hence [F]- = [F] using id_sym by blast
4043    AOT_hence [F]x1...xn  ¬[F]x1...xn for x1xn
4044      using "rule=E" "thm-relation-negation:1" by fast
4045    AOT_thus ¬([F]x1...xn  [F]x1...xn) for x1xn
4046      using "≡E" RAA by metis
4047  qed
4048  thus ?thesis
4049    using "≡dfI" "=-infix" by blast
4050qed
4051
4052AOT_theorem "thm-relation-negation:6": p  (p)-
4053proof -
4054  AOT_have ¬(p = (p)-)
4055  proof (rule RAA(2))
4056    AOT_show p  p
4057      using "if-p-then-p".
4058  next
4059    AOT_assume p = (p)-
4060    AOT_hence (p)- = p using id_sym by blast
4061    AOT_hence p  ¬p
4062      using "rule=E" "thm-relation-negation:3" by fast
4063    AOT_thus ¬(p  p)
4064      using "≡E" RAA by metis
4065  qed
4066  thus ?thesis
4067    using "≡dfI" "=-infix" by blast
4068qed
4069
4070AOT_theorem "thm-relation-negation:7": (p)- = (¬p)
4071  apply (rule "df-relation-negation[zero]"[THEN "=dfE"(1)])
4072  using "cqt:2[lambda0]"[axiom_inst] "rel-neg-T:2[zero]" "propositions-lemma:1" id_trans by blast+
4073
4074AOT_theorem "thm-relation-negation:8": p = q  (¬p) = (¬q)
4075proof(rule "→I")
4076  AOT_assume p = q
4077  moreover AOT_have (¬p) using "log-prop-prop:2".
4078  moreover AOT_have (¬p) = (¬p) using calculation(2) "=I" by blast
4079  ultimately AOT_show (¬p) = (¬q)
4080    using "rule=E" by fast
4081qed
4082
4083AOT_theorem "thm-relation-negation:9": p = q  (p)- = (q)-
4084proof(rule "→I")
4085  AOT_assume p = q
4086  AOT_hence (¬p) = (¬q) using "thm-relation-negation:8" "→E" by blast
4087  AOT_thus (p)- = (q)-
4088    using "thm-relation-negation:7" id_sym id_trans by metis
4089qed
4090
4091AOT_define Necessary :: ‹Π  φ› ("Necessary'(_')")
4092  "contingent-properties:1": Necessary([F]) df x1...∀xn [F]x1...xn
4093
4094AOT_define Necessary0 :: ‹φ  φ› ("Necessary0'(_')")
4095  "contingent-properties:1[zero]": Necessary0(p) df p
4096
4097AOT_define Impossible :: ‹Π  φ› ("Impossible'(_')")
4098  "contingent-properties:2": Impossible([F]) df F & x1...∀xn ¬[F]x1...xn
4099
4100AOT_define Impossible0 :: ‹φ  φ› ("Impossible0'(_')")
4101  "contingent-properties:2[zero]": Impossible0(p) df ¬p
4102
4103AOT_define NonContingent :: ‹Π  φ› ("NonContingent'(_')")
4104  "contingent-properties:3": NonContingent([F]) df Necessary([F])  Impossible([F])
4105
4106AOT_define NonContingent0 :: ‹φ  φ› ("NonContingent0'(_')")
4107  "contingent-properties:3[zero]": NonContingent0(p) df Necessary0(p)  Impossible0(p)
4108
4109AOT_define Contingent :: ‹Π  φ› ("Contingent'(_')")
4110  "contingent-properties:4": Contingent([F]) df F & ¬(Necessary([F])  Impossible([F]))
4111
4112AOT_define Contingent0 :: ‹φ  φ› ("Contingent0'(_')")
4113  "contingent-properties:4[zero]": Contingent0(p) df ¬(Necessary0(p)  Impossible0(p))
4114
4115
4116AOT_theorem "thm-cont-prop:1": NonContingent([F])  NonContingent([F]-)
4117proof (rule "≡I"; rule "→I")
4118  AOT_assume NonContingent([F])
4119  AOT_hence Necessary([F])  Impossible([F])
4120    using "≡dfE"[OF "contingent-properties:3"] by blast
4121  moreover {
4122    AOT_assume Necessary([F])
4123    AOT_hence (x1...∀xn [F]x1...xn)
4124      using "≡dfE"[OF "contingent-properties:1"] by blast
4125    moreover AOT_modally_strict {
4126      AOT_assume x1...∀xn [F]x1...xn
4127      AOT_hence [F]x1...xn for x1xn using "∀E" by blast
4128      AOT_hence ¬[F]-x1...xn for x1xn
4129        by (meson "≡E"(6) "oth-class-taut:3:a" "thm-relation-negation:2" "≡E"(1))
4130      AOT_hence x1...∀xn ¬[F]-x1...xn using "∀I" by fast
4131    }
4132    ultimately AOT_have (x1...∀xn ¬[F]-x1...xn)
4133      using "RN[prem]"[where Γ="{«x1...∀xn [F]x1...xn»}", simplified] by blast
4134    AOT_hence Impossible([F]-)
4135      using "≡Df"[OF "contingent-properties:2", THEN "≡S"(1), OF "rel-neg-T:3", THEN "≡E"(2)]
4136      by blast
4137  }
4138  moreover {
4139    AOT_assume Impossible([F])
4140    AOT_hence (x1...∀xn ¬[F]x1...xn)
4141      using "≡Df"[OF "contingent-properties:2", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst], THEN "≡E"(1)]
4142      by blast
4143    moreover AOT_modally_strict {
4144      AOT_assume x1...∀xn ¬[F]x1...xn
4145      AOT_hence ¬[F]x1...xn for x1xn using "∀E" by blast
4146      AOT_hence [F]-x1...xn for x1xn
4147        by (meson "≡E"(6) "oth-class-taut:3:a" "thm-relation-negation:1" "≡E"(1))
4148      AOT_hence x1...∀xn [F]-x1...xn using "∀I" by fast
4149    }
4150    ultimately AOT_have (x1...∀xn [F]-x1...xn)
4151      using "RN[prem]"[where Γ="{«x1...∀xn ¬[F]x1...xn»}"] by blast
4152    AOT_hence Necessary([F]-)
4153      using "≡dfI"[OF "contingent-properties:1"] by blast
4154  }
4155  ultimately AOT_have Necessary([F]-)  Impossible([F]-)
4156    using "∨E"(1) "∨I" "→I" by metis
4157  AOT_thus NonContingent([F]-)
4158    using "≡dfI"[OF "contingent-properties:3"] by blast
4159next
4160  AOT_assume NonContingent([F]-)
4161  AOT_hence Necessary([F]-)  Impossible([F]-)
4162    using "≡dfE"[OF "contingent-properties:3"] by blast
4163  moreover {
4164    AOT_assume Necessary([F]-)
4165    AOT_hence (x1...∀xn [F]-x1...xn)
4166      using "≡dfE"[OF "contingent-properties:1"] by blast
4167    moreover AOT_modally_strict {
4168      AOT_assume x1...∀xn [F]-x1...xn
4169      AOT_hence [F]-x1...xn for x1xn using "∀E" by blast
4170      AOT_hence ¬[F]x1...xn for x1xn
4171        by (meson "≡E"(6) "oth-class-taut:3:a" "thm-relation-negation:1" "≡E"(2))
4172      AOT_hence x1...∀xn ¬[F]x1...xn using "∀I" by fast
4173    }
4174    ultimately AOT_have x1...∀xn ¬[F]x1...xn
4175      using "RN[prem]"[where Γ="{«x1...∀xn [F]-x1...xn»}"] by blast
4176    AOT_hence Impossible([F])
4177      using "≡Df"[OF "contingent-properties:2", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst], THEN "≡E"(2)]
4178      by blast
4179  }
4180  moreover {
4181    AOT_assume Impossible([F]-)
4182    AOT_hence (x1...∀xn ¬[F]-x1...xn)
4183      using "≡Df"[OF "contingent-properties:2", THEN "≡S"(1), OF "rel-neg-T:3", THEN "≡E"(1)]
4184      by blast
4185    moreover AOT_modally_strict {
4186      AOT_assume x1...∀xn ¬[F]-x1...xn
4187      AOT_hence ¬[F]-x1...xn for x1xn using "∀E" by blast
4188      AOT_hence [F]x1...xn for x1xn 
4189        using "thm-relation-negation:1"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1)]
4190              "useful-tautologies:1"[THEN "→E"] by blast
4191      AOT_hence x1...∀xn [F]x1...xn using "∀I" by fast
4192    }
4193    ultimately AOT_have (x1...∀xn [F]x1...xn)
4194      using "RN[prem]"[where Γ="{«x1...∀xn ¬[F]-x1...xn»}"] by blast
4195    AOT_hence Necessary([F])
4196      using "≡dfI"[OF "contingent-properties:1"] by blast
4197  }
4198  ultimately AOT_have Necessary([F])  Impossible([F])
4199    using "∨E"(1) "∨I" "→I" by metis
4200  AOT_thus NonContingent([F])
4201    using "≡dfI"[OF "contingent-properties:3"] by blast
4202qed
4203
4204AOT_theorem "thm-cont-prop:2": Contingent([F])  x [F]x & x ¬[F]x
4205proof -
4206  AOT_have Contingent([F])  ¬(Necessary([F])  Impossible([F]))
4207    using "contingent-properties:4"[THEN "≡Df", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst]]
4208    by blast
4209  also AOT_have ...  ¬Necessary([F]) & ¬Impossible([F])
4210    using "oth-class-taut:5:d" by fastforce
4211  also AOT_have ...  ¬Impossible([F]) & ¬Necessary([F])
4212    by (simp add: "Commutativity of &")
4213  also AOT_have ...  x [F]x & ¬Necessary([F])
4214  proof (rule "oth-class-taut:4:e"[THEN "→E"])
4215    AOT_have ¬Impossible([F])  ¬¬ x [F]x
4216      apply (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
4217      apply (AOT_subst x [F]x ¬ x ¬[F]x)
4218       apply (simp add: "conventions:4" "≡Df")
4219      apply (AOT_subst (reverse) ¬¬x ¬[F]x x ¬[F]x)
4220       apply (simp add: "oth-class-taut:3:b")
4221      using "contingent-properties:2"[THEN "≡Df", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst]] by blast
4222    also AOT_have ...  x [F]x
4223      using "conventions:5"[THEN "≡Df", symmetric] by blast
4224    finally AOT_show ¬Impossible([F])  x [F]x .
4225  qed
4226  also AOT_have ...  x [F]x & x ¬[F]x
4227  proof (rule "oth-class-taut:4:f"[THEN "→E"])
4228    AOT_have ¬Necessary([F])  ¬¬x ¬[F]x
4229      apply (rule "oth-class-taut:4:b"[THEN "≡E"(1)])
4230      apply (AOT_subst x ¬[F]x ¬ x ¬¬[F]x)
4231       apply (simp add: "conventions:4" "≡Df")
4232      apply (AOT_subst (reverse) ¬¬[F]x [F]x bound: x)
4233       apply (simp add: "oth-class-taut:3:b")
4234      apply (AOT_subst (reverse) ¬¬x [F]x x [F]x)
4235      by (auto simp: "oth-class-taut:3:b" "contingent-properties:1" "≡Df")
4236    also AOT_have ...  x ¬[F]x
4237      using "conventions:5"[THEN "≡Df", symmetric] by blast
4238    finally AOT_show ¬Necessary([F])  x ¬[F]x.
4239  qed
4240  finally show ?thesis.
4241qed
4242
4243AOT_theorem "thm-cont-prop:3": Contingent([F])  Contingent([F]-) for F::<κ> AOT_var›
4244proof -
4245  {
4246    fix Π :: <κ>
4247    AOT_assume Π
4248    moreover AOT_have F (Contingent([F])  x [F]x & x ¬[F]x)
4249      using "thm-cont-prop:2" GEN by fast
4250    ultimately  AOT_have Contingent([Π])  x [Π]x & x ¬[Π]x
4251      using "thm-cont-prop:2" "∀E" by fast
4252  } note 1 = this
4253  AOT_have Contingent([F])  x [F]x & x ¬[F]x
4254    using "thm-cont-prop:2" by blast
4255  also AOT_have ...  x ¬[F]x & x [F]x
4256    by (simp add: "Commutativity of &")
4257  also AOT_have ...  x [F]-x & x [F]x
4258    by (AOT_subst [F]-x ¬[F]x bound: x)
4259       (auto simp: "thm-relation-negation:1" "oth-class-taut:3:a")
4260  also AOT_have ...  x [F]-x & x ¬[F]-x
4261    by (AOT_subst (reverse) [F]x ¬[F]-x bound: x)
4262       (auto simp: "thm-relation-negation:2" "oth-class-taut:3:a")
4263  also AOT_have ...  Contingent([F]-)
4264    using 1[OF "rel-neg-T:3", symmetric] by blast
4265  finally show ?thesis.
4266qed
4267
4268AOT_define concrete_if_concrete :: ‹Π› ("L")  L_def: L =df x E!x  E!x]
4269
4270AOT_theorem "thm-noncont-e-e:1": Necessary(L)
4271proof -
4272  AOT_modally_strict {
4273    fix x
4274    AOT_have x E!x  E!x] by "cqt:2[lambda]"
4275    moreover AOT_have x using "cqt:2[const_var]"[axiom_inst] by blast
4276    moreover AOT_have E!x  E!x using "if-p-then-p" by blast
4277    ultimately AOT_have x E!x  E!x]x
4278      using "β←C" by blast
4279  }
4280  AOT_hence 0: x x E!x  E!x]x
4281    using RN GEN by blast
4282  show ?thesis
4283    apply (rule "=dfI"(2)[OF L_def])
4284     apply "cqt:2[lambda]"
4285    by (rule "contingent-properties:1"[THEN "≡dfI", OF 0])
4286qed
4287
4288AOT_theorem "thm-noncont-e-e:2": Impossible([L]-)
4289proof -
4290  AOT_modally_strict {
4291    fix x
4292
4293    AOT_have 0: F (¬[F]-x  [F]x)
4294      using "thm-relation-negation:2" GEN by fast
4295    AOT_have ¬x E!x  E!x]-x  x E!x  E!x]x
4296      by (rule 0[THEN "∀E"(1)]) "cqt:2[lambda]"
4297    moreover {
4298      AOT_have x E!x  E!x] by "cqt:2[lambda]"
4299      moreover AOT_have x using "cqt:2[const_var]"[axiom_inst] by blast
4300      moreover AOT_have E!x  E!x using "if-p-then-p" by blast
4301      ultimately AOT_have x E!x  E!x]x
4302        using "β←C" by blast
4303    }
4304    ultimately AOT_have ¬x E!x  E!x]-x
4305      using "≡E" by blast
4306  }
4307  AOT_hence 0: x ¬x E!x  E!x]-x
4308    using RN GEN by fast
4309  show ?thesis
4310    apply (rule "=dfI"(2)[OF L_def])
4311     apply "cqt:2[lambda]"
4312    apply (rule "contingent-properties:2"[THEN "≡dfI"]; rule "&I")
4313     using "rel-neg-T:3"
4314     apply blast
4315    using 0
4316    by blast
4317qed
4318
4319AOT_theorem "thm-noncont-e-e:3": NonContingent(L)
4320  using "thm-noncont-e-e:1"
4321  by (rule "contingent-properties:3"[THEN "≡dfI", OF "∨I"(1)])
4322
4323AOT_theorem "thm-noncont-e-e:4": NonContingent([L]-)
4324proof -
4325  AOT_have 0: F (NonContingent([F])  NonContingent([F]-))
4326    using "thm-cont-prop:1" "∀I" by fast
4327  moreover AOT_have 1: L
4328    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
4329  AOT_show NonContingent([L]-)
4330    using "∀E"(1)[OF 0, OF 1, THEN "≡E"(1), OF "thm-noncont-e-e:3"] by blast
4331qed
4332
4333AOT_theorem "thm-noncont-e-e:5": F G (F  «G::<κ>» & NonContingent([F]) & NonContingent([G]))
4334proof (rule "∃I")+
4335  {
4336    AOT_have F [F]  [F]- using "thm-relation-negation:5" GEN by fast
4337    moreover AOT_have L
4338      by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
4339    ultimately AOT_have L  [L]- using "∀E" by blast
4340  }
4341  AOT_thus L  [L]- & NonContingent(L) & NonContingent([L]-)
4342    using "thm-noncont-e-e:3" "thm-noncont-e-e:4" "&I" by metis
4343next
4344  AOT_show [L]-
4345    using "rel-neg-T:3" by blast
4346next
4347  AOT_show L
4348      by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
4349qed
4350
4351AOT_theorem "lem-cont-e:1": x ([F]x & ¬[F]x)  x (¬[F]x & [F]x)
4352proof -
4353  AOT_have x ([F]x & ¬[F]x)  x ([F]x & ¬[F]x)
4354    using "BF◇" "CBF◇" "≡I" by blast
4355  also AOT_have   x ([F]x &  ¬[F]x)
4356    by (AOT_subst ([F]x & ¬[F]x) [F]x &  ¬[F]x bound: x)
4357       (auto simp: "S5Basic:11" "cqt-further:7")
4358  also AOT_have   x (¬[F]x & [F]x)
4359    by (AOT_subst ¬[F]x & [F]x  [F]x & ¬[F]x bound: x)
4360       (auto simp: "Commutativity of &" "cqt-further:7")
4361  also AOT_have   x (¬[F]x & [F]x)
4362    by (AOT_subst (¬[F]x & [F]x) ¬[F]x & [F]x bound: x)
4363       (auto simp: "S5Basic:11" "oth-class-taut:3:a")
4364  also AOT_have   x (¬[F]x & [F]x)
4365    using "BF◇" "CBF◇" "≡I" by fast
4366  finally show ?thesis.
4367qed
4368
4369AOT_theorem "lem-cont-e:2": x ([F]x & ¬[F]x)  x ([F]-x & ¬[F]-x)
4370proof -
4371  AOT_have x ([F]x & ¬[F]x)  x (¬[F]x & [F]x)
4372    using "lem-cont-e:1".
4373  also AOT_have   x ([F]-x & ¬[F]-x)
4374    apply (AOT_subst ¬[F]-x [F]x bound: x)
4375     apply (simp add: "thm-relation-negation:2")
4376    apply (AOT_subst [F]-x ¬[F]x bound: x)
4377     apply (simp add: "thm-relation-negation:1")
4378    by (simp add: "oth-class-taut:3:a")
4379  finally show ?thesis.
4380qed
4381
4382AOT_theorem "thm-cont-e:1": x (E!x & ¬E!x)
4383proof (rule "CBF◇"[THEN "→E"])
4384  AOT_have x (E!x & ¬𝒜E!x) using "qml:4"[axiom_inst] "BF◇"[THEN "→E"] by blast
4385  then AOT_obtain a where (E!a & ¬𝒜E!a) using "∃E"[rotated] by blast
4386  AOT_hence θ: E!a & ¬𝒜E!a
4387    using "KBasic2:3"[THEN "→E"] by blast
4388  AOT_have ξ: E!a & 𝒜¬E!a
4389    by (AOT_subst  𝒜¬E!a ¬𝒜E!a)
4390       (auto simp: "logic-actual-nec:1"[axiom_inst] θ)
4391  AOT_have ζ: E!a & 𝒜¬E!a
4392    by (AOT_subst 𝒜¬E!a 𝒜¬E!a)
4393       (auto simp add: "Act-Sub:4" ξ)
4394  AOT_hence E!a & ¬E!a
4395    using "&E" "&I" "Act-Sub:3"[THEN "→E"] by blast
4396  AOT_hence (E!a & ¬E!a) using "S5Basic:11"[THEN "≡E"(2)] by simp
4397  AOT_thus x (E!x & ¬E!x) using "∃I"(2) by fast
4398qed
4399
4400AOT_theorem "thm-cont-e:2": x (¬E!x & E!x)
4401proof -
4402  AOT_have F (x ([F]x & ¬[F]x)  x (¬[F]x & [F]x))
4403    using "lem-cont-e:1" GEN by fast
4404  AOT_hence (x (E!x & ¬E!x)  x (¬E!x & E!x))
4405    using "∀E"(1) "cqt:2[concrete]"[axiom_inst] by blast
4406  thus ?thesis using "thm-cont-e:1" "≡E" by blast
4407qed
4408
4409AOT_theorem "thm-cont-e:3": x E!x
4410proof (rule "CBF◇"[THEN "→E"])
4411  AOT_obtain a where (E!a & ¬E!a)
4412    using "∃E"[rotated, OF "thm-cont-e:1"[THEN "BF◇"[THEN "→E"]]] by blast
4413  AOT_hence E!a
4414    using "KBasic2:3"[THEN "→E", THEN "&E"(1)] by blast
4415  AOT_thus x E!x using "∃I" by fast
4416qed
4417
4418AOT_theorem "thm-cont-e:4": x ¬E!x
4419proof (rule "CBF◇"[THEN "→E"])
4420  AOT_obtain a where (E!a & ¬E!a)
4421    using "∃E"[rotated, OF "thm-cont-e:1"[THEN "BF◇"[THEN "→E"]]] by blast
4422  AOT_hence ¬E!a
4423    using "KBasic2:3"[THEN "→E", THEN "&E"(2)] by blast
4424  AOT_hence ¬E!a
4425    using "4◇"[THEN "→E"] by blast
4426  AOT_thus x ¬E!x using "∃I" by fast
4427qed
4428
4429AOT_theorem "thm-cont-e:5": Contingent([E!])
4430proof -
4431  AOT_have F (Contingent([F])  x [F]x & x ¬[F]x)
4432    using "thm-cont-prop:2" GEN by fast
4433  AOT_hence Contingent([E!])  x E!x & x ¬E!x
4434    using "∀E"(1) "cqt:2[concrete]"[axiom_inst] by blast
4435  thus ?thesis
4436    using "thm-cont-e:3" "thm-cont-e:4" "≡E"(2) "&I" by blast
4437qed
4438
4439AOT_theorem "thm-cont-e:6": Contingent([E!]-)
4440proof -
4441  AOT_have F (Contingent([«F::<κ>»])  Contingent([F]-))
4442    using "thm-cont-prop:3" GEN by fast
4443  AOT_hence Contingent([E!])  Contingent([E!]-)
4444    using "∀E" "cqt:2[concrete]"[axiom_inst] by fast
4445  thus ?thesis using "thm-cont-e:5" "≡E" by blast
4446qed
4447
4448AOT_theorem "thm-cont-e:7": FG (Contingent([«F::<κ>»]) & Contingent([G]) & F  G)
4449proof (rule "∃I")+
4450  AOT_have F [«F::<κ>»]  [F]- using "thm-relation-negation:5" GEN by fast
4451  AOT_hence [E!]  [E!]-
4452    using "∀E" "cqt:2[concrete]"[axiom_inst] by fast
4453  AOT_thus Contingent([E!]) & Contingent([E!]-) & [E!]  [E!]-
4454    using "thm-cont-e:5" "thm-cont-e:6" "&I" by metis
4455next
4456  AOT_show E!-
4457    by (fact AOT)
4458next
4459  AOT_show E! by (fact "cqt:2[concrete]"[axiom_inst])
4460qed
4461
4462AOT_theorem "property-facts:1": NonContingent([F])  ¬G (Contingent([G]) & G = F)
4463proof (rule "→I"; rule "raa-cor:2")
4464  AOT_assume NonContingent([F])
4465  AOT_hence 1: Necessary([F])  Impossible([F])
4466    using "contingent-properties:3"[THEN "≡dfE"] by blast
4467  AOT_assume G (Contingent([G]) & G = F)
4468  then AOT_obtain G where Contingent([G]) & G = F using "∃E"[rotated] by blast
4469  AOT_hence Contingent([F]) using "rule=E" "&E" by blast
4470  AOT_hence ¬(Necessary([F])  Impossible([F]))
4471    using "contingent-properties:4"[THEN "≡Df", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst], THEN "≡E"(1)] by blast
4472  AOT_thus (Necessary([F])  Impossible([F])) & ¬(Necessary([F])  Impossible([F]))
4473    using 1 "&I" by blast
4474qed
4475
4476AOT_theorem "property-facts:2": Contingent([F])  ¬G (NonContingent([G]) & G = F)
4477proof (rule "→I"; rule "raa-cor:2")
4478  AOT_assume Contingent([F])
4479  AOT_hence 1: ¬(Necessary([F])  Impossible([F]))
4480    using "contingent-properties:4"[THEN "≡Df", THEN "≡S"(1), OF "cqt:2[const_var]"[axiom_inst], THEN "≡E"(1)] by blast
4481  AOT_assume G (NonContingent([G]) & G = F)
4482  then AOT_obtain G where NonContingent([G]) & G = F using "∃E"[rotated] by blast
4483  AOT_hence NonContingent([F]) using "rule=E" "&E" by blast
4484  AOT_hence Necessary([F])  Impossible([F])
4485    using "contingent-properties:3"[THEN "≡dfE"] by blast
4486  AOT_thus (Necessary([F])  Impossible([F])) & ¬(Necessary([F])  Impossible([F]))
4487    using 1 "&I" by blast
4488qed
4489
4490AOT_theorem "property-facts:3": L  [L]- & L  E! & L  E!- & [L]-  [E!]- & E!  [E!]-
4491proof -
4492  AOT_have noneqI: Π  Π' if φ{Π} and ¬φ{Π'} for φ and Π Π' :: <κ>
4493    apply (rule "=-infix"[THEN "≡dfI"]; rule "raa-cor:2")
4494    using "rule=E"[where φ=φ and τ=Π and σ = Π'] that "&I" by blast
4495  AOT_have contingent_denotes: Π if Contingent([Π]) for Π :: <κ>
4496    using that "contingent-properties:4"[THEN "≡dfE", THEN "&E"(1)] by blast
4497  AOT_have not_noncontingent_if_contingent: ¬NonContingent([Π]) if Contingent([Π]) for Π :: <κ>
4498  proof(rule RAA(2))
4499    AOT_show ¬(Necessary([Π])  Impossible([Π]))
4500      using that "contingent-properties:4"[THEN "≡Df", THEN "≡S"(1), OF contingent_denotes[OF that], THEN "≡E"(1)] by blast
4501  next
4502    AOT_assume NonContingent([Π])
4503    AOT_thus Necessary([Π])  Impossible([Π])
4504      using "contingent-properties:3"[THEN "≡dfE"] by blast
4505  qed
4506
4507  show ?thesis
4508  proof (safe intro!: "&I")
4509    AOT_show L  [L]-
4510      apply (rule "=dfI"(2)[OF L_def])
4511       apply "cqt:2[lambda]"
4512      apply (rule "∀E"(1)[where φ="λ Π . «Π  [Π]-»"])
4513       apply (rule GEN) apply (fact AOT)
4514      by "cqt:2[lambda]"
4515  next
4516    AOT_show L  E!
4517      apply (rule noneqI)
4518      using "thm-noncont-e-e:3" not_noncontingent_if_contingent[OF "thm-cont-e:5"]
4519      by auto
4520  next
4521    AOT_show L  E!-
4522      apply (rule noneqI)
4523      using "thm-noncont-e-e:3" apply fast
4524      apply (rule not_noncontingent_if_contingent)
4525      apply (rule "∀E"(1)[where φ="λ Π . «Contingent([Π])  Contingent([Π]-)»", rotated, OF contingent_denotes, THEN "≡E"(1), rotated])
4526      using "thm-cont-prop:3" GEN apply fast
4527      using "thm-cont-e:5" by fast+
4528  next
4529    AOT_show [L]-  E!-
4530      apply (rule noneqI)
4531      using "thm-noncont-e-e:4" apply fast
4532      apply (rule not_noncontingent_if_contingent)
4533      apply (rule "∀E"(1)[where φ="λ Π . «Contingent([Π])  Contingent([Π]-)»", rotated, OF contingent_denotes, THEN "≡E"(1), rotated])
4534      using "thm-cont-prop:3" GEN apply fast
4535      using "thm-cont-e:5" by fast+
4536  next
4537    AOT_show E!  E!-
4538      apply (rule "=dfI"(2)[OF L_def])
4539       apply "cqt:2[lambda]"
4540      apply (rule "∀E"(1)[where φ="λ Π . «Π  [Π]-»"])
4541       apply (rule GEN) apply (fact AOT)
4542      by (fact "cqt:2[concrete]"[axiom_inst])
4543  qed
4544qed
4545
4546AOT_theorem "thm-cont-propos:1": NonContingent0(p)  NonContingent0(((p)-))
4547proof(rule "≡I"; rule "→I")
4548  AOT_assume NonContingent0(p)
4549  AOT_hence Necessary0(p)  Impossible0(p)
4550    using "contingent-properties:3[zero]"[THEN "≡dfE"] by blast
4551  moreover {
4552    AOT_assume Necessary0(p)
4553    AOT_hence 1: p using "contingent-properties:1[zero]"[THEN "≡dfE"] by blast
4554    AOT_have ¬((p)-)
4555      by (AOT_subst ¬((p)-) p)
4556         (auto simp add: 1 "thm-relation-negation:4")
4557    AOT_hence Impossible0(((p)-))
4558      by (rule "contingent-properties:2[zero]"[THEN "≡dfI"])
4559  }
4560  moreover {
4561    AOT_assume Impossible0(p)
4562    AOT_hence 1: ¬p
4563      by (rule "contingent-properties:2[zero]"[THEN "≡dfE"])
4564    AOT_have ((p)-)
4565      by (AOT_subst ((p)-) ¬p) 
4566         (auto simp: 1 "thm-relation-negation:3")
4567    AOT_hence Necessary0(((p)-))
4568      by (rule "contingent-properties:1[zero]"[THEN "≡dfI"])
4569  }
4570  ultimately AOT_have Necessary0(((p)-))  Impossible0(((p)-))
4571    using "∨E"(1) "∨I" "→I" by metis
4572  AOT_thus NonContingent0(((p)-))
4573    using "contingent-properties:3[zero]"[THEN "≡dfI"] by blast
4574next
4575  AOT_assume NonContingent0(((p)-))
4576  AOT_hence Necessary0(((p)-))  Impossible0(((p)-))
4577    using "contingent-properties:3[zero]"[THEN "≡dfE"] by blast
4578  moreover {
4579    AOT_assume Impossible0(((p)-))
4580    AOT_hence 1: ¬((p)-)
4581      by (rule "contingent-properties:2[zero]"[THEN "≡dfE"])
4582    AOT_have p
4583      by (AOT_subst (reverse) p ¬((p)-))
4584         (auto simp: 1 "thm-relation-negation:4")
4585    AOT_hence Necessary0(p)
4586      using "contingent-properties:1[zero]"[THEN "≡dfI"] by blast
4587  }
4588  moreover {
4589    AOT_assume Necessary0(((p)-))
4590    AOT_hence 1: ((p)-)
4591      by (rule "contingent-properties:1[zero]"[THEN "≡dfE"])
4592    AOT_have ¬p
4593      by (AOT_subst (reverse) ¬p ((p)-))
4594         (auto simp: 1 "thm-relation-negation:3")
4595    AOT_hence Impossible0(p)
4596      by (rule "contingent-properties:2[zero]"[THEN "≡dfI"])
4597  }
4598  ultimately AOT_have Necessary0(p)  Impossible0(p)
4599    using "∨E"(1) "∨I" "→I" by metis
4600  AOT_thus NonContingent0(p)
4601    using "contingent-properties:3[zero]"[THEN "≡dfI"] by blast
4602qed
4603
4604AOT_theorem "thm-cont-propos:2": Contingent0(φ)  φ & ¬φ
4605proof -
4606  AOT_have Contingent0(φ)  ¬(Necessary0(φ)  Impossible0(φ))
4607    using "contingent-properties:4[zero]"[THEN "≡Df"] by simp
4608  also AOT_have   ¬Necessary0(φ) & ¬Impossible0(φ)
4609    by (fact AOT)
4610  also AOT_have   ¬Impossible0(φ) & ¬Necessary0(φ)
4611    by (fact AOT)
4612  also AOT_have   φ & ¬φ
4613    apply (AOT_subst φ ¬¬φ)
4614     apply (simp add: "conventions:5" "≡Df")
4615    apply (AOT_subst Impossible0(φ) ¬φ)
4616     apply (simp add: "contingent-properties:2[zero]" "≡Df")
4617    apply (AOT_subst (reverse) ¬φ ¬φ)
4618     apply (simp add: "KBasic:11")
4619    apply (AOT_subst Necessary0(φ) φ)
4620     apply (simp add: "contingent-properties:1[zero]" "≡Df")
4621    by (simp add: "oth-class-taut:3:a")
4622  finally show ?thesis.
4623qed
4624
4625AOT_theorem "thm-cont-propos:3": Contingent0(p)  Contingent0(((p)-))
4626proof -
4627  AOT_have Contingent0(p)  p & ¬p using "thm-cont-propos:2".
4628  also AOT_have   ¬p & p by (fact AOT)
4629  also AOT_have   ((p)-) & p
4630    by (AOT_subst ((p)-) ¬p)
4631       (auto simp: "thm-relation-negation:3" "oth-class-taut:3:a")
4632  also AOT_have   ((p)-) & ¬((p)-)
4633    by (AOT_subst ¬((p)-) p)
4634       (auto simp: "thm-relation-negation:4" "oth-class-taut:3:a")
4635  also AOT_have   Contingent0(((p)-))
4636    using "thm-cont-propos:2"[symmetric] by blast
4637  finally show ?thesis.
4638qed
4639
4640AOT_define noncontingent_prop :: ‹φ› ("p0")
4641  p0_def: "(p0) =df (x (E!x  E!x))"
4642
4643AOT_theorem "thm-noncont-propos:1":  Necessary0((p0))
4644proof(rule "contingent-properties:1[zero]"[THEN "≡dfI"])
4645  AOT_show (p0)
4646    apply (rule "=dfI"(2)[OF p0_def])
4647    using "log-prop-prop:2" apply simp
4648    using "if-p-then-p" RN GEN by fast
4649qed
4650
4651AOT_theorem "thm-noncont-propos:2": Impossible0(((p0)-))
4652proof(rule "contingent-properties:2[zero]"[THEN "≡dfI"])
4653  AOT_show ¬((p0)-)
4654    apply (AOT_subst ((p0)-) ¬p0)
4655    using "thm-relation-negation:3" GEN "∀E"(1)[rotated, OF "log-prop-prop:2"] apply fast
4656    apply (AOT_subst (reverse) ¬¬p0 p0)
4657     apply (simp add: "oth-class-taut:3:b")
4658    apply (rule "=dfI"(2)[OF p0_def])
4659    using "log-prop-prop:2" apply simp
4660    using "if-p-then-p" RN GEN by fast
4661qed
4662
4663AOT_theorem "thm-noncont-propos:3": NonContingent0((p0))
4664  apply(rule "contingent-properties:3[zero]"[THEN "≡dfI"])
4665  using "thm-noncont-propos:1" "∨I" by blast
4666
4667AOT_theorem "thm-noncont-propos:4": NonContingent0(((p0)-))
4668  apply(rule "contingent-properties:3[zero]"[THEN "≡dfI"])
4669  using "thm-noncont-propos:2" "∨I" by blast
4670
4671AOT_theorem "thm-noncont-propos:5": pq (NonContingent0((p)) & NonContingent0((q)) & p  q)
4672proof(rule "∃I")+
4673  AOT_have 0: φ  (φ)- for φ
4674    using "thm-relation-negation:6" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] by fast
4675  AOT_thus NonContingent0((p0)) & NonContingent0(((p0)-)) & (p0)  (p0)-
4676    using "thm-noncont-propos:3" "thm-noncont-propos:4" "&I" by auto
4677qed(auto simp: "log-prop-prop:2")
4678
4679AOT_act_theorem "no-cnac": ¬x(E!x & ¬𝒜E!x)
4680proof(rule "raa-cor:2")
4681  AOT_assume x(E!x & ¬𝒜E!x)
4682  then AOT_obtain a where a: E!a & ¬𝒜E!a
4683    using "∃E"[rotated] by blast
4684  AOT_hence 𝒜¬E!a using "&E" "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] by blast
4685  AOT_hence ¬E!a using "logic-actual"[act_axiom_inst, THEN "→E"] by blast
4686  AOT_hence E!a & ¬E!a using a "&E" "&I" by blast
4687  AOT_thus p & ¬p for p using "raa-cor:1" by blast
4688qed
4689
4690AOT_theorem "pos-not-pna:1": ¬𝒜x (E!x & ¬𝒜E!x)
4691proof(rule "raa-cor:2")
4692  AOT_assume 𝒜x (E!x & ¬𝒜E!x)
4693  AOT_hence x 𝒜(E!x & ¬𝒜E!x)
4694    using "Act-Basic:10"[THEN "≡E"(1)] by blast
4695  then AOT_obtain a where 𝒜(E!a & ¬𝒜E!a) using "∃E"[rotated] by blast
4696  AOT_hence 1: 𝒜E!a & 𝒜¬𝒜E!a using "Act-Basic:2"[THEN "≡E"(1)] by blast
4697  AOT_hence ¬𝒜𝒜E!a using "&E"(2) "logic-actual-nec:1"[axiom_inst, THEN "≡E"(1)] by blast
4698  AOT_hence ¬𝒜E!a using "logic-actual-nec:4"[axiom_inst, THEN "≡E"(1)] RAA by blast
4699  AOT_thus p & ¬p for p using 1[THEN "&E"(1)] "&I" "raa-cor:1" by blast
4700qed
4701
4702AOT_theorem "pos-not-pna:2": ¬x(E!x & ¬𝒜E!x)
4703proof (rule RAA(1))
4704  AOT_show ¬𝒜x (E!x & ¬𝒜E!x) using "pos-not-pna:1" by blast
4705next
4706  AOT_assume ¬¬x (E!x & ¬𝒜E!x)
4707  AOT_hence x (E!x & ¬𝒜E!x)
4708    using "KBasic:12"[THEN "≡E"(2)] by blast
4709  AOT_thus 𝒜x (E!x & ¬𝒜E!x)
4710    using "nec-imp-act"[THEN "→E"] by blast
4711qed
4712
4713AOT_theorem "pos-not-pna:3": x (E!x & ¬𝒜E!x)
4714proof -
4715  AOT_obtain a where (E!a & ¬𝒜E!a)
4716    using "qml:4"[axiom_inst] "BF◇"[THEN "→E"] "∃E"[rotated] by blast
4717  AOT_hence θ: E!a and ξ: ¬𝒜E!a using "KBasic2:3"[THEN "→E"] "&E" by blast+
4718  AOT_have ¬𝒜E!a using ξ "KBasic:11"[THEN "≡E"(2)] by blast
4719  AOT_hence ¬𝒜E!a using "Act-Basic:6"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)] by blast
4720  AOT_hence E!a & ¬𝒜E!a using θ "&I" by blast
4721  thus ?thesis using "∃I" by fast
4722qed
4723
4724AOT_define contingent_prop :: φ ("q0")
4725  q0_def: (q0) =df (x (E!x & ¬𝒜E!x))
4726
4727AOT_theorem q0_prop: q0 & ¬q0
4728  apply (rule "=dfI"(2)[OF q0_def])
4729  apply (fact "log-prop-prop:2")
4730  apply (rule "&I")
4731   apply (fact "qml:4"[axiom_inst])
4732  by (fact "pos-not-pna:2")
4733
4734AOT_theorem "basic-prop:1": Contingent0((q0))
4735proof(rule "contingent-properties:4[zero]"[THEN "≡dfI"])
4736  AOT_have ¬Necessary0((q0)) & ¬Impossible0((q0))
4737  proof (rule "&I"; rule "=dfI"(2)[OF q0_def]; (rule "log-prop-prop:2" | rule "raa-cor:2"))
4738    AOT_assume Necessary0(x (E!x & ¬𝒜E!x))
4739    AOT_hence x (E!x & ¬𝒜E!x)
4740      using "contingent-properties:1[zero]"[THEN "≡dfE"] by blast
4741    AOT_hence 𝒜x (E!x & ¬𝒜E!x)
4742      using "Act-Basic:8"[THEN "→E"] "qml:2"[axiom_inst, THEN "→E"] by blast
4743    AOT_thus 𝒜x (E!x & ¬𝒜E!x) & ¬𝒜x (E!x & ¬𝒜E!x)
4744      using "pos-not-pna:1" "&I" by blast
4745  next
4746    AOT_assume Impossible0(x (E!x & ¬𝒜E!x))
4747    AOT_hence ¬(x (E!x & ¬𝒜E!x))
4748      using "contingent-properties:2[zero]"[THEN "≡dfE"] by blast
4749    AOT_hence ¬(x (E!x & ¬𝒜E!x)) using "KBasic2:1"[THEN "≡E"(1)] by blast
4750    AOT_thus (x (E!x & ¬𝒜E!x)) & ¬(x (E!x & ¬𝒜E!x))
4751      using "qml:4"[axiom_inst] "&I" by blast
4752  qed
4753  AOT_thus ¬(Necessary0((q0))  Impossible0((q0)))
4754    using "oth-class-taut:5:d" "≡E"(2) by blast
4755qed
4756
4757AOT_theorem "basic-prop:2": p Contingent0((p))
4758  using "∃I"(1)[rotated, OF "log-prop-prop:2"] "basic-prop:1" by blast
4759
4760AOT_theorem "basic-prop:3": Contingent0(((q0)-))
4761  apply (AOT_subst ((q0)-) ¬q0)
4762   apply (insert "thm-relation-negation:3" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"]; fast)
4763  apply (rule "contingent-properties:4[zero]"[THEN "≡dfI"])
4764  apply (rule "oth-class-taut:5:d"[THEN "≡E"(2)])
4765  apply (rule "&I")
4766   apply (rule "contingent-properties:1[zero]"[THEN "df-rules-formulas[3]", THEN "useful-tautologies:5"[THEN "→E"], THEN "→E"])
4767   apply (rule "conventions:5"[THEN "≡dfE"])
4768   apply (rule "=dfE"(2)[OF q0_def])
4769    apply (rule "log-prop-prop:2")
4770   apply (rule q0_prop[THEN "&E"(1)])
4771  apply (rule "contingent-properties:2[zero]"[THEN "df-rules-formulas[3]", THEN "useful-tautologies:5"[THEN "→E"], THEN "→E"])
4772  apply (rule "conventions:5"[THEN "≡dfE"])
4773  by (rule q0_prop[THEN "&E"(2)])
4774
4775AOT_theorem "basic-prop:4": pq (p  q & Contingent0(p) & Contingent0(q))
4776proof(rule "∃I")+
4777  AOT_have 0: φ  (φ)- for φ
4778    using "thm-relation-negation:6" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] by fast
4779  AOT_show (q0)  (q0)- & Contingent0(q0) & Contingent0(((q0)-))
4780    using "basic-prop:1" "basic-prop:3" "&I" 0 by presburger
4781qed(auto simp: "log-prop-prop:2")
4782
4783AOT_theorem "proposition-facts:1": NonContingent0(p)  ¬q (Contingent0(q) & q = p)
4784proof(rule "→I"; rule "raa-cor:2")
4785  AOT_assume NonContingent0(p)
4786  AOT_hence 1: Necessary0(p)  Impossible0(p)
4787    using "contingent-properties:3[zero]"[THEN "≡dfE"] by blast
4788  AOT_assume q (Contingent0(q) & q = p)
4789  then AOT_obtain q where Contingent0(q) & q = p using "∃E"[rotated] by blast
4790  AOT_hence Contingent0(p) using "rule=E" "&E" by fast
4791  AOT_thus (Necessary0(p)  Impossible0(p)) & ¬(Necessary0(p)  Impossible0(p))
4792    using "contingent-properties:4[zero]"[THEN "≡dfE"] 1 "&I" by blast
4793qed
4794
4795AOT_theorem "proposition-facts:2": Contingent0(p)  ¬q (NonContingent0(q) & q = p)
4796proof(rule "→I"; rule "raa-cor:2")
4797  AOT_assume Contingent0(p)
4798  AOT_hence 1: ¬(Necessary0(p)  Impossible0(p))
4799    using "contingent-properties:4[zero]"[THEN "≡dfE"] by blast
4800  AOT_assume q (NonContingent0(q) & q = p)
4801  then AOT_obtain q where NonContingent0(q) & q = p using "∃E"[rotated] by blast
4802  AOT_hence NonContingent0(p) using "rule=E" "&E" by fast
4803  AOT_thus (Necessary0(p)  Impossible0(p)) & ¬(Necessary0(p)  Impossible0(p))
4804    using "contingent-properties:3[zero]"[THEN "≡dfE"] 1 "&I" by blast
4805qed
4806
4807AOT_theorem "proposition-facts:3": (p0)  (p0)- & (p0)  (q0) & (p0)  (q0)- & (p0)-  (q0)- & (q0)  (q0)-
4808proof -
4809  {
4810    fix χ φ ψ
4811    AOT_assume χ{φ}
4812    moreover AOT_assume ¬χ{ψ}
4813    ultimately AOT_have ¬(χ{φ}  χ{ψ})
4814      using RAA "≡E" by metis
4815    moreover {
4816      AOT_have pq ((¬(χ{p}  χ{q}))  p  q)
4817        by (rule "∀I"; rule "∀I"; rule "pos-not-equiv-ne:4[zero]")
4818      AOT_hence ((¬(χ{φ}  χ{ψ}))  φ  ψ)
4819        using "∀E" "log-prop-prop:2" by blast
4820    }
4821    ultimately AOT_have φ  ψ
4822      using "→E" by blast
4823  } note 0 = this
4824  AOT_have contingent_neg: Contingent0(φ)  Contingent0(((φ)-)) for φ
4825    using "thm-cont-propos:3" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] by fast
4826  AOT_have not_noncontingent_if_contingent: ¬NonContingent0(φ) if Contingent0(φ) for φ
4827    apply (rule "contingent-properties:3[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4828    using that "contingent-properties:4[zero]"[THEN "≡dfE"] by blast
4829  show ?thesis
4830    apply (rule "&I")+
4831    using "thm-relation-negation:6" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] apply fast
4832       apply (rule 0)
4833    using "thm-noncont-propos:3" apply fast
4834       apply (rule not_noncontingent_if_contingent)
4835       apply (fact AOT)
4836      apply (rule 0)
4837    apply (rule "thm-noncont-propos:3")
4838      apply (rule not_noncontingent_if_contingent)
4839      apply (rule contingent_neg[THEN "≡E"(1)])
4840      apply (fact AOT)
4841     apply (rule 0)
4842    apply (rule "thm-noncont-propos:4")
4843      apply (rule not_noncontingent_if_contingent)
4844      apply (rule contingent_neg[THEN "≡E"(1)])
4845     apply (fact AOT)
4846    using "thm-relation-negation:6" "∀I" "∀E"(1)[rotated, OF "log-prop-prop:2"] by fast
4847qed
4848
4849AOT_define ContingentlyTrue :: ‹φ  φ› ("ContingentlyTrue'(_')")
4850  "cont-tf:1": ContingentlyTrue(p) df p & ¬p
4851
4852AOT_define ContingentlyFalse :: ‹φ  φ› ("ContingentlyFalse'(_')")
4853  "cont-tf:2": ContingentlyFalse(p) df ¬p & p
4854
4855AOT_theorem "cont-true-cont:1": ContingentlyTrue((p))  Contingent0((p))
4856proof(rule "→I")
4857  AOT_assume ContingentlyTrue((p))
4858  AOT_hence 1: p and 2: ¬p using "cont-tf:1"[THEN "≡dfE"] "&E" by blast+
4859  AOT_have ¬Necessary0((p))
4860    apply (rule "contingent-properties:1[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4861    using 2 "KBasic:11"[THEN "≡E"(2)] by blast
4862  moreover AOT_have ¬Impossible0((p))
4863    apply (rule "contingent-properties:2[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4864    apply (rule "conventions:5"[THEN "≡dfE"])
4865    using "T◇"[THEN "→E", OF 1].
4866  ultimately AOT_have ¬(Necessary0((p))  Impossible0((p)))
4867    using DeMorgan(2)[THEN "≡E"(2)] "&I" by blast
4868  AOT_thus Contingent0((p))
4869    using "contingent-properties:4[zero]"[THEN "≡dfI"] by blast
4870qed
4871
4872AOT_theorem "cont-true-cont:2": ContingentlyFalse((p))  Contingent0((p))
4873proof(rule "→I")
4874  AOT_assume ContingentlyFalse((p))
4875  AOT_hence 1: ¬p and 2: p using "cont-tf:2"[THEN "≡dfE"] "&E" by blast+
4876  AOT_have ¬Necessary0((p))
4877    apply (rule "contingent-properties:1[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4878    using "KBasic:11"[THEN "≡E"(2)] "T◇"[THEN "→E", OF 1] by blast
4879  moreover AOT_have ¬Impossible0((p))
4880    apply (rule "contingent-properties:2[zero]"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
4881    apply (rule "conventions:5"[THEN "≡dfE"])
4882    using 2.
4883  ultimately AOT_have ¬(Necessary0((p))  Impossible0((p)))
4884    using DeMorgan(2)[THEN "≡E"(2)] "&I" by blast
4885  AOT_thus Contingent0((p))
4886    using "contingent-properties:4[zero]"[THEN "≡dfI"] by blast
4887qed
4888
4889AOT_theorem "cont-true-cont:3": ContingentlyTrue((p))  ContingentlyFalse(((p)-))
4890proof(rule "≡I"; rule "→I")
4891  AOT_assume ContingentlyTrue((p))
4892  AOT_hence 0: p & ¬p using "cont-tf:1"[THEN "≡dfE"] by blast
4893  AOT_have 1: ContingentlyFalse(¬p)
4894    apply (rule "cont-tf:2"[THEN "≡dfI"])
4895    apply (AOT_subst (reverse) ¬¬p p)
4896    by (auto simp: "oth-class-taut:3:b" 0)
4897  AOT_show ContingentlyFalse(((p)-))
4898    apply (AOT_subst ((p)-) ¬p)
4899    by (auto simp: "thm-relation-negation:3" 1)
4900next
4901  AOT_assume 1: ContingentlyFalse(((p)-))
4902  AOT_have ContingentlyFalse(¬p)
4903    by (AOT_subst (reverse) ¬p ((p)-))
4904       (auto simp: "thm-relation-negation:3" 1)
4905  AOT_hence ¬¬p & ¬p using "cont-tf:2"[THEN "≡dfE"] by blast
4906  AOT_hence p & ¬p
4907    using "&I" "&E" "useful-tautologies:1"[THEN "→E"] by metis
4908  AOT_thus ContingentlyTrue((p))
4909    using "cont-tf:1"[THEN "≡dfI"] by blast
4910qed
4911
4912AOT_theorem "cont-true-cont:4": ContingentlyFalse((p))  ContingentlyTrue(((p)-))
4913proof(rule "≡I"; rule "→I")
4914  AOT_assume ContingentlyFalse(p)
4915  AOT_hence 0: ¬p & p
4916    using "cont-tf:2"[THEN "≡dfE"] by blast
4917  AOT_have ¬p & ¬¬p
4918    by (AOT_subst (reverse) ¬¬p p)
4919       (auto simp: "oth-class-taut:3:b" 0)
4920  AOT_hence 1: ContingentlyTrue(¬p)
4921    by (rule "cont-tf:1"[THEN "≡dfI"])
4922  AOT_show ContingentlyTrue(((p)-))
4923    by (AOT_subst ((p)-) ¬p)
4924       (auto simp: "thm-relation-negation:3" 1)
4925next
4926  AOT_assume 1: ContingentlyTrue(((p)-))
4927  AOT_have ContingentlyTrue(¬p)
4928    by (AOT_subst (reverse) ¬p ((p)-))
4929       (auto simp add: "thm-relation-negation:3" 1)
4930  AOT_hence 2: ¬p & ¬¬p using "cont-tf:1"[THEN "≡dfE"] by blast
4931  AOT_have p
4932    by (AOT_subst p ¬¬p)
4933       (auto simp add: "oth-class-taut:3:b" 2[THEN "&E"(2)])
4934  AOT_hence ¬p & p using 2[THEN "&E"(1)] "&I" by blast
4935  AOT_thus ContingentlyFalse(p)
4936    by (rule "cont-tf:2"[THEN "≡dfI"])
4937qed
4938
4939AOT_theorem "cont-true-cont:5": (ContingentlyTrue((p)) & Necessary0((q)))  p  q
4940proof (rule "→I"; frule "&E"(1); drule "&E"(2); rule "raa-cor:1")
4941  AOT_assume ContingentlyTrue((p))
4942  AOT_hence ¬p
4943    using "cont-tf:1"[THEN "≡dfE"] "&E" by blast
4944  AOT_hence 0: ¬p using "KBasic:11"[THEN "≡E"(2)] by blast
4945  AOT_assume Necessary0((q))
4946  moreover AOT_assume ¬(p  q)
4947  AOT_hence p = q
4948    using "=-infix"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1)]
4949          "useful-tautologies:1"[THEN "→E"] by blast
4950  ultimately AOT_have Necessary0((p)) using "rule=E" id_sym by blast
4951  AOT_hence p
4952    using "contingent-properties:1[zero]"[THEN "≡dfE"] by blast
4953  AOT_thus p & ¬p using 0 "&I" by blast
4954qed
4955
4956AOT_theorem "cont-true-cont:6": (ContingentlyFalse((p)) & Impossible0((q)))  p  q
4957proof (rule "→I"; frule "&E"(1); drule "&E"(2); rule "raa-cor:1")
4958  AOT_assume ContingentlyFalse((p))
4959  AOT_hence p
4960    using "cont-tf:2"[THEN "≡dfE"] "&E" by blast
4961  AOT_hence 1: ¬¬p
4962    using "conventions:5"[THEN "≡dfE"] by blast
4963  AOT_assume Impossible0((q))
4964  moreover AOT_assume ¬(p  q)
4965  AOT_hence p = q
4966    using "=-infix"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1)]
4967          "useful-tautologies:1"[THEN "→E"] by blast
4968  ultimately AOT_have Impossible0((p)) using "rule=E" id_sym by blast
4969  AOT_hence ¬p
4970    using "contingent-properties:2[zero]"[THEN "≡dfE"] by blast
4971  AOT_thus ¬p & ¬¬p using 1 "&I" by blast
4972qed
4973
4974AOT_act_theorem "q0cf:1": ContingentlyFalse(q0)
4975  apply (rule "cont-tf:2"[THEN "≡dfI"])
4976  apply (rule "=dfI"(2)[OF q0_def])
4977   apply (fact "log-prop-prop:2")
4978  apply (rule "&I")
4979   apply (fact "no-cnac")
4980  by (fact "qml:4"[axiom_inst])
4981
4982AOT_act_theorem "q0cf:2": ContingentlyTrue(((q0)-))
4983  apply (rule "cont-tf:1"[THEN "≡dfI"])
4984  apply (rule "=dfI"(2)[OF q0_def])
4985   apply (fact "log-prop-prop:2")
4986  apply (rule "&I")
4987     apply (rule "thm-relation-negation:3"[unvarify p, OF "log-prop-prop:2", THEN "≡E"(2)])
4988     apply (fact "no-cnac")
4989    apply (rule "rule=E"[rotated, OF "thm-relation-negation:7"[unvarify p, OF "log-prop-prop:2", THEN id_sym]])
4990  apply (AOT_subst (reverse) ¬¬(x  (E!x & ¬𝒜E!x)) x (E!x & ¬𝒜E!x))
4991  by (auto simp: "oth-class-taut:3:b" "qml:4"[axiom_inst])
4992
4993(* TODO: q0cf-rem skipped for now *)
4994
4995AOT_theorem "cont-tf-thm:1": p ContingentlyTrue((p))
4996proof(rule "∨E"(1)[OF "exc-mid"]; rule "→I"; rule "∃I")
4997  AOT_assume q0
4998  AOT_hence q0 & ¬q0 using q0_prop[THEN "&E"(2)] "&I" by blast
4999  AOT_thus ContingentlyTrue(q0)
5000    by (rule "cont-tf:1"[THEN "≡dfI"])
5001next
5002  AOT_assume ¬q0
5003  AOT_hence ¬q0 & q0 using q0_prop[THEN "&E"(1)] "&I" by blast
5004  AOT_hence ContingentlyFalse(q0)
5005    by (rule "cont-tf:2"[THEN "≡dfI"])
5006  AOT_thus ContingentlyTrue(((q0)-))
5007    by (rule "cont-true-cont:4"[unvarify p, OF "log-prop-prop:2", THEN "≡E"(1)])
5008qed(auto simp: "log-prop-prop:2")
5009
5010
5011AOT_theorem "cont-tf-thm:2": p ContingentlyFalse((p))
5012proof(rule "∨E"(1)[OF "exc-mid"]; rule "→I"; rule "∃I")
5013  AOT_assume q0
5014  AOT_hence q0 & ¬q0 using q0_prop[THEN "&E"(2)] "&I" by blast
5015  AOT_hence ContingentlyTrue(q0)
5016    by (rule "cont-tf:1"[THEN "≡dfI"])
5017  AOT_thus ContingentlyFalse(((q0)-))
5018    by (rule "cont-true-cont:3"[unvarify p, OF "log-prop-prop:2", THEN "≡E"(1)])
5019next
5020  AOT_assume ¬q0
5021  AOT_hence ¬q0 & q0 using q0_prop[THEN "&E"(1)] "&I" by blast
5022  AOT_thus ContingentlyFalse(q0)
5023    by (rule "cont-tf:2"[THEN "≡dfI"])
5024qed(auto simp: "log-prop-prop:2")
5025
5026(* TODO: inspect modally strict subproof involving obtained variable *)
5027AOT_theorem "property-facts1:1": Fx ([F]x & ¬[F]x)
5028proof -
5029  fix x
5030  AOT_obtain p1 where ContingentlyTrue((p1))
5031    using "cont-tf-thm:1" "∃E"[rotated] by blast
5032  AOT_hence 1: p1 & ¬p1 using "cont-tf:1"[THEN "≡dfE"] by blast
5033  AOT_modally_strict {
5034    AOT_have for arbitrary p:  (z p]x  p)
5035      by (rule "beta-C-cor:3"[THEN "∀E"(2)]) cqt_2_lambda_inst_prover
5036    AOT_hence for arbitrary p:   (z p]x  p)
5037      by (rule RN)
5038    AOT_hence p (z p]x  p) using GEN by fast
5039    AOT_hence (z p1]x  p1) using "∀E" by fast
5040  } note 2 = this
5041  AOT_hence (z p1]x  p1) using "∀E" by blast
5042  AOT_hence z p1]x using 1[THEN "&E"(1)] "qml:2"[axiom_inst, THEN "→E"] "≡E"(2) by blast
5043  moreover AOT_have ¬z p1]x
5044    apply (AOT_subst_using subst: 2[THEN "qml:2"[axiom_inst, THEN "→E"]])
5045    using 1[THEN "&E"(2)] by blast
5046  ultimately AOT_have z p1]x & ¬z p1]x using "&I" by blast
5047  AOT_hence x (z p1]x & ¬z p1]x) using "∃I"(2) by fast
5048  moreover AOT_have z p1] by "cqt:2[lambda]"
5049  ultimately AOT_show Fx ([F]x & ¬[F]x) by (rule "∃I"(1))
5050qed
5051
5052(* TODO: inspect modally strict subproof involving obtained variable *)
5053AOT_theorem "property-facts1:2": Fx (¬[F]x & [F]x)
5054proof -
5055  fix x
5056  AOT_obtain p1 where ContingentlyFalse((p1))
5057    using "cont-tf-thm:2" "∃E"[rotated] by blast
5058  AOT_hence 1: ¬p1 & p1 using "cont-tf:2"[THEN "≡dfE"] by blast
5059  AOT_modally_strict {
5060    AOT_have for arbitrary p:  (z p]x  p)
5061      by (rule "beta-C-cor:3"[THEN "∀E"(2)]) cqt_2_lambda_inst_prover
5062    AOT_hence for arbitrary p:  (¬z p]x  ¬p)
5063      using "oth-class-taut:4:b" "≡E" by blast
5064    AOT_hence for arbitrary p:  (¬z p]x  ¬p)
5065      by (rule RN)
5066    AOT_hence p (¬z p]x  ¬p) using GEN by fast
5067    AOT_hence (¬z p1]x  ¬p1) using "∀E" by fast
5068  } note 2 = this
5069  AOT_hence (¬z p1]x  ¬p1) using "∀E" by blast
5070  AOT_hence 3: ¬z p1]x using 1[THEN "&E"(1)] "qml:2"[axiom_inst, THEN "→E"] "≡E"(2) by blast
5071  AOT_modally_strict {
5072    AOT_have for arbitrary p:  (z p]x  p)
5073      by (rule "beta-C-cor:3"[THEN "∀E"(2)]) cqt_2_lambda_inst_prover
5074    AOT_hence for arbitrary p:  (z p]x  p)
5075      by (rule RN)
5076    AOT_hence p (z p]x  p) using GEN by fast
5077    AOT_hence (z p1]x  p1) using "∀E" by fast
5078  } note 4 = this
5079  AOT_have z p1]x
5080    apply (AOT_subst_using subst: 4[THEN "qml:2"[axiom_inst, THEN "→E"]])
5081    using 1[THEN "&E"(2)] by blast
5082  AOT_hence ¬z p1]x & z p1]x using 3 "&I" by blast
5083  AOT_hence x (¬z p1]x & z p1]x) using "∃I"(2) by fast
5084  moreover AOT_have z p1] by "cqt:2[lambda]"
5085  ultimately AOT_show Fx (¬[F]x & [F]x) by (rule "∃I"(1))
5086qed
5087
5088context
5089begin
5090
5091private AOT_lemma eqnotnec_123_Aux_ζ: [L]x  (E!x  E!x)
5092    apply (rule "=dfI"(2)[OF L_def])
5093     apply "cqt:2[lambda]"
5094    apply (rule "beta-C-meta"[THEN "→E"])
5095  by "cqt:2[lambda]"
5096
5097private AOT_lemma eqnotnec_123_Aux_ω: z φ]x  φ
5098    by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5099
5100private AOT_lemma eqnotnec_123_Aux_θ: φ  x([L]x  z φ]x)
5101proof(rule "≡I"; rule "→I"; (rule "∀I")?)
5102  fix x
5103  AOT_assume 1: φ
5104  AOT_have [L]x  (E!x  E!x) using eqnotnec_123_Aux_ζ.
5105  also AOT_have   φ
5106    using "if-p-then-p" 1 "≡I" "→I" by simp
5107  also AOT_have   z φ]x
5108    using "Commutativity of ≡"[THEN "≡E"(1)] eqnotnec_123_Aux_ω by blast
5109  finally AOT_show [L]x  z φ]x.
5110next
5111  fix x
5112  AOT_assume x([L]x  z φ]x)
5113  AOT_hence [L]x  z φ]x using "∀E" by blast
5114  also AOT_have   φ using eqnotnec_123_Aux_ω.
5115  finally AOT_have φ  [L]x using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5116  also AOT_have   E!x  E!x using eqnotnec_123_Aux_ζ.
5117  finally AOT_show φ using "≡E" "if-p-then-p" by fast
5118qed
5119private lemmas eqnotnec_123_Aux_ξ =  eqnotnec_123_Aux_θ[THEN "oth-class-taut:4:b"[THEN "≡E"(1)],
5120                      THEN "conventions:3"[THEN "≡Df", THEN "≡E"(1), THEN "&E"(1)],
5121                      THEN "RM◇"]
5122private lemmas eqnotnec_123_Aux_ξ' = eqnotnec_123_Aux_θ[THEN "conventions:3"[THEN "≡Df", THEN "≡E"(1), THEN "&E"(1)], THEN "RM◇"]
5123
5124AOT_theorem "eqnotnec:1": FG(x([F]x  [G]x) & ¬x([F]x  [G]x))
5125proof-
5126  AOT_obtain p1 where ContingentlyTrue(p1) using "cont-tf-thm:1" "∃E"[rotated] by blast
5127  AOT_hence p1 & ¬p1 using "cont-tf:1"[THEN "≡dfE"] by blast
5128  AOT_hence x ([L]x  z p1]x) & ¬x([L]x  z p1]x)
5129    apply - apply (rule "&I")
5130    using "&E" eqnotnec_123_Aux_θ[THEN "≡E"(1)] eqnotnec_123_Aux_ξ "→E" by fast+
5131  AOT_hence G (x([L]x  [G]x) & ¬x([L]x  [G]x))
5132    by (rule "∃I") "cqt:2[lambda]"
5133  AOT_thus FG (x([F]x  [G]x) & ¬x([F]x  [G]x))
5134    apply (rule "∃I")
5135    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5136qed
5137
5138AOT_theorem "eqnotnec:2": FG(¬x([F]x  [G]x) & x([F]x  [G]x))
5139proof-
5140  AOT_obtain p1 where ContingentlyFalse(p1) using "cont-tf-thm:2" "∃E"[rotated] by blast
5141  AOT_hence ¬p1 & p1 using "cont-tf:2"[THEN "≡dfE"] by blast
5142  AOT_hence ¬x ([L]x  z p1]x) & x([L]x  z p1]x)
5143    apply - apply (rule "&I")
5144    using "&E" eqnotnec_123_Aux_θ[THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1)] eqnotnec_123_Aux_ξ' "→E" by fast+
5145  AOT_hence G (¬x([L]x  [G]x) & x([L]x  [G]x))
5146    by (rule "∃I") "cqt:2[lambda]"
5147  AOT_thus FG (¬x([F]x  [G]x) & x([F]x  [G]x))
5148    apply (rule "∃I")
5149    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5150qed
5151
5152AOT_theorem "eqnotnec:3": FG(𝒜¬x([F]x  [G]x) & x([F]x  [G]x))
5153proof-
5154  AOT_have ¬𝒜q0
5155    apply (rule "=dfI"(2)[OF q0_def])
5156     apply (fact "log-prop-prop:2")
5157    by (fact AOT)
5158  AOT_hence 𝒜¬q0
5159    using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] by blast
5160  AOT_hence 𝒜¬x ([L]x  z q0]x)
5161    using eqnotnec_123_Aux_θ[THEN "oth-class-taut:4:b"[THEN "≡E"(1)],
5162            THEN "conventions:3"[THEN "≡Df", THEN "≡E"(1), THEN "&E"(1)],
5163            THEN "RA[2]", THEN "act-cond"[THEN "→E"], THEN "→E"] by blast
5164  moreover AOT_have x ([L]x  z q0]x) using eqnotnec_123_Aux_ξ'[THEN "→E"] q0_prop[THEN "&E"(1)] by blast
5165  ultimately AOT_have 𝒜¬x ([L]x  z q0]x) & x ([L]x  z q0]x) using "&I" by blast
5166  AOT_hence G (𝒜¬x([L]x  [G]x) & x([L]x  [G]x))
5167    by (rule "∃I") "cqt:2[lambda]"
5168  AOT_thus FG (𝒜¬x([F]x  [G]x) & x([F]x  [G]x))
5169    apply (rule "∃I")
5170    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5171qed
5172
5173end
5174
5175(* TODO[IMPORTANT]: proof of 219.4 ζ: appeal to (159.2) requires a theorem, but the result has local
5176   assumptions! *)
5177AOT_theorem "eqnotnec:4": FG(x([F]x  [G]x) & ¬x([F]x  [G]x))
5178proof(rule GEN)
5179  fix F
5180
5181  AOT_have Aux_A:  ψ  x([F]x  z [F]z & ψ]x) for ψ
5182  proof(rule "→I"; rule GEN)
5183    AOT_modally_strict {
5184    fix x
5185    AOT_assume 0: ψ
5186    AOT_have z [F]z & ψ]x  [F]x & ψ
5187      by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5188    also AOT_have ...  [F]x
5189      apply (rule "≡I"; rule "→I")
5190      using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5191      using 0 "&I" by blast
5192    finally AOT_show [F]x  z [F]z & ψ]x
5193      using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5194    }
5195  qed
5196
5197  AOT_have Aux_B:  ψ  x([F]x  z [F]z & ψ  ¬ψ]x) for ψ
5198  proof (rule "→I"; rule GEN)
5199    AOT_modally_strict {
5200      fix x
5201      AOT_assume 0: ψ
5202      AOT_have z ([F]z & ψ)  ¬ψ]x  (([F]x & ψ)  ¬ψ)
5203        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5204      also AOT_have ...  [F]x
5205        apply (rule "≡I"; rule "→I")
5206        using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5207        apply (rule "∨I"(1)) using 0 "&I" by blast
5208      finally AOT_show [F]x  z ([F]z & ψ)  ¬ψ]x
5209        using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5210    }
5211  qed
5212
5213  AOT_have Aux_C:  ¬ψ  ¬z(z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z) for ψ
5214  proof(rule "RM◇"; rule "→I"; rule "raa-cor:2")
5215  AOT_modally_strict {
5216      AOT_assume 0: ¬ψ
5217      AOT_assume z (z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z)
5218      AOT_hence z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5219      moreover AOT_have z [F]z & ψ]z  [F]z & ψ for z
5220          by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5221      moreover AOT_have z ([F]z & ψ)  ¬ψ]z  (([F]z & ψ)  ¬ψ) for z
5222        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5223      ultimately AOT_have [F]z & ψ  (([F]z & ψ)  ¬ψ) for z
5224        using "Commutativity of ≡"[THEN "≡E"(1)] "≡E"(5) by meson
5225      moreover AOT_have (([F]z & ψ)  ¬ψ) for z using 0 "∨I" by blast
5226      ultimately AOT_have ψ using "≡E" "&E" by metis
5227      AOT_thus ψ & ¬ψ using 0 "&I" by blast
5228    }
5229  qed
5230
5231  AOT_have Aux_D: z ([F]z  z [F]z & ψ]z)  (¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x)) for ψ
5232  proof (rule "→I")
5233    AOT_assume A: z([F]z  z [F]z & ψ]z)
5234    AOT_show ¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x)
5235    proof(rule "≡I"; rule "KBasic:13"[THEN "→E"];
5236          rule "RN[prem]"[where Γ="{«z([F]z  z [F]z & ψ]z)»}", simplified];
5237          (rule "useful-tautologies:5"[THEN "→E"]; rule "→I")?)
5238      AOT_modally_strict {
5239        AOT_assume z ([F]z  z [F]z & ψ]z)
5240        AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5241        AOT_assume x ([F]x  z [F]z & ψ  ¬ψ]x)
5242        AOT_hence 2: [F]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5243        AOT_have z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "≡E" 1 2 by meson
5244        AOT_thus x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5245      }
5246    next
5247      AOT_modally_strict {
5248        AOT_assume z ([F]z  z [F]z & ψ]z)
5249        AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5250        AOT_assume x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)
5251        AOT_hence 2: z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5252        AOT_have [F]z  z [F]z & ψ  ¬ψ]z for z using 1 2 "≡E" by meson
5253        AOT_thus x ([F]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5254      }
5255    qed(auto simp: A)
5256  qed
5257
5258  AOT_obtain p1 where p1_prop: p1 & ¬p1 using "cont-tf-thm:1" "∃E"[rotated] "cont-tf:1"[THEN "≡dfE"] by blast
5259  {
5260    AOT_assume 1: x([F]x  z [F]z & p1]x)
5261    AOT_have 2: x([F]x  z [F]z & p1  ¬p1]x)
5262      using Aux_B[THEN "→E", OF p1_prop[THEN "&E"(1)]].
5263    AOT_have ¬x(z [F]z & p1]x  z [F]z & p1  ¬p1]x)
5264      using Aux_C[THEN "→E", OF p1_prop[THEN "&E"(2)]].
5265    AOT_hence 3: ¬x([F]x  z [F]z & p1  ¬p1]x)
5266      using Aux_D[THEN "→E", OF 1, THEN "≡E"(1)] by blast
5267    AOT_hence x([F]x  z [F]z & p1  ¬p1]x) & ¬x([F]x  z [F]z & p1  ¬p1]x) using 2 "&I" by blast
5268    AOT_hence G (x ([F]x  [G]x) & ¬x([F]x  [G]x))
5269      by (rule "∃I"(1)) "cqt:2[lambda]"
5270  }
5271  moreover {
5272    AOT_assume 2: ¬x([F]x  z [F]z & p1]x)
5273    AOT_hence ¬x([F]x  z [F]z & p1]x)
5274      using "KBasic:11"[THEN "≡E"(1)] by blast
5275    AOT_hence x ([F]x  z [F]z & p1]x) & ¬x([F]x  z [F]z & p1]x)
5276      using Aux_A[THEN "→E", OF p1_prop[THEN "&E"(1)]] "&I" by blast
5277    AOT_hence G (x ([F]x  [G]x) & ¬x([F]x  [G]x))
5278      by (rule "∃I"(1)) "cqt:2[lambda]"
5279  }
5280  ultimately AOT_show G (x ([F]x  [G]x) & ¬x([F]x  [G]x))
5281    using "∨E"(1)[OF "exc-mid"] "→I" by blast
5282qed
5283
5284AOT_theorem "eqnotnec:5": FG(¬x([F]x  [G]x) & x([F]x  [G]x))
5285proof(rule GEN)
5286  fix F
5287
5288  AOT_have Aux_A:  ψ  x([F]x  z [F]z & ψ]x) for ψ
5289  proof(rule "RM◇"; rule "→I"; rule GEN)
5290    AOT_modally_strict {
5291    fix x
5292    AOT_assume 0: ψ
5293    AOT_have z [F]z & ψ]x  [F]x & ψ
5294      by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5295    also AOT_have ...  [F]x
5296      apply (rule "≡I"; rule "→I")
5297      using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5298      using 0 "&I" by blast
5299    finally AOT_show [F]x  z [F]z & ψ]x
5300      using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5301    }
5302  qed
5303
5304  AOT_have Aux_B:  ψ  x([F]x  z [F]z & ψ  ¬ψ]x) for ψ
5305  proof (rule "RM◇"; rule "→I"; rule GEN)
5306    AOT_modally_strict {
5307      fix x
5308      AOT_assume 0: ψ
5309      AOT_have z ([F]z & ψ)  ¬ψ]x  (([F]x & ψ)  ¬ψ)
5310        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5311      also AOT_have ...  [F]x
5312        apply (rule "≡I"; rule "→I")
5313        using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5314        apply (rule "∨I"(1)) using 0 "&I" by blast
5315      finally AOT_show [F]x  z ([F]z & ψ)  ¬ψ]x
5316        using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5317    }
5318  qed
5319
5320  AOT_have Aux_C:  ¬ψ  ¬z(z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z) for ψ
5321  proof(rule "→I"; rule "raa-cor:2")
5322  AOT_modally_strict {
5323      AOT_assume 0: ¬ψ
5324      AOT_assume z (z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z)
5325      AOT_hence z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5326      moreover AOT_have z [F]z & ψ]z  [F]z & ψ for z
5327          by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5328      moreover AOT_have z ([F]z & ψ)  ¬ψ]z  (([F]z & ψ)  ¬ψ) for z
5329        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5330      ultimately AOT_have [F]z & ψ  (([F]z & ψ)  ¬ψ) for z
5331        using "Commutativity of ≡"[THEN "≡E"(1)] "≡E"(5) by meson
5332      moreover AOT_have (([F]z & ψ)  ¬ψ) for z using 0 "∨I" by blast
5333      ultimately AOT_have ψ using "≡E" "&E" by metis
5334      AOT_thus ψ & ¬ψ using 0 "&I" by blast
5335    }
5336  qed
5337
5338  AOT_have Aux_D: z ([F]z  z [F]z & ψ]z)  (¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x)) for ψ
5339  proof (rule "→I"; rule "≡I"; (rule "useful-tautologies:5"[THEN "→E"]; rule "→I")?)
5340    AOT_modally_strict {
5341      AOT_assume z ([F]z  z [F]z & ψ]z)
5342      AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5343      AOT_assume x ([F]x  z [F]z & ψ  ¬ψ]x)
5344      AOT_hence 2: [F]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5345      AOT_have z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "≡E" 1 2 by meson
5346      AOT_thus x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5347    }
5348  next
5349    AOT_modally_strict {
5350      AOT_assume z ([F]z  z [F]z & ψ]z)
5351      AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5352      AOT_assume x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)
5353      AOT_hence 2: z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5354      AOT_have [F]z  z [F]z & ψ  ¬ψ]z for z using 1 2 "≡E" by meson
5355      AOT_thus x ([F]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5356    }
5357  qed
5358
5359  AOT_obtain p1 where p1_prop: ¬p1 & p1 using "cont-tf-thm:2" "∃E"[rotated] "cont-tf:2"[THEN "≡dfE"] by blast
5360  {
5361    AOT_assume 1: x([F]x  z [F]z & p1]x)
5362    AOT_have 2: x([F]x  z [F]z & p1  ¬p1]x)
5363      using Aux_B[THEN "→E", OF p1_prop[THEN "&E"(2)]].
5364    AOT_have ¬x(z [F]z & p1]x  z [F]z & p1  ¬p1]x)
5365      using Aux_C[THEN "→E", OF p1_prop[THEN "&E"(1)]].
5366    AOT_hence 3: ¬x([F]x  z [F]z & p1  ¬p1]x)
5367      using Aux_D[THEN "→E", OF 1, THEN "≡E"(1)] by blast
5368    AOT_hence ¬x([F]x  z [F]z & p1  ¬p1]x) & x([F]x  z [F]z & p1  ¬p1]x) using 2 "&I" by blast
5369    AOT_hence G (¬x ([F]x  [G]x) & x([F]x  [G]x))
5370      by (rule "∃I"(1)) "cqt:2[lambda]"
5371  }
5372  moreover {
5373    AOT_assume 2: ¬x([F]x  z [F]z & p1]x)
5374    AOT_hence ¬x([F]x  z [F]z & p1]x)
5375      using "KBasic:11"[THEN "≡E"(1)] by blast
5376    AOT_hence ¬x ([F]x  z [F]z & p1]x) & x([F]x  z [F]z & p1]x)
5377      using Aux_A[THEN "→E", OF p1_prop[THEN "&E"(2)]] "&I" by blast
5378    AOT_hence G (¬x ([F]x  [G]x) & x([F]x  [G]x))
5379      by (rule "∃I"(1)) "cqt:2[lambda]"
5380  }
5381  ultimately AOT_show G (¬x ([F]x  [G]x) & x([F]x  [G]x))
5382    using "∨E"(1)[OF "exc-mid"] "→I" by blast
5383qed
5384
5385AOT_theorem "eqnotnec:6": FG(𝒜¬x([F]x  [G]x) & x([F]x  [G]x))
5386proof(rule GEN)
5387  fix F
5388
5389  AOT_have Aux_A:  ψ  x([F]x  z [F]z & ψ]x) for ψ
5390  proof(rule "RM◇"; rule "→I"; rule GEN)
5391    AOT_modally_strict {
5392    fix x
5393    AOT_assume 0: ψ
5394    AOT_have z [F]z & ψ]x  [F]x & ψ
5395      by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5396    also AOT_have ...  [F]x
5397      apply (rule "≡I"; rule "→I")
5398      using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5399      using 0 "&I" by blast
5400    finally AOT_show [F]x  z [F]z & ψ]x
5401      using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5402    }
5403  qed
5404
5405  AOT_have Aux_B:  ψ  x([F]x  z [F]z & ψ  ¬ψ]x) for ψ
5406  proof (rule "RM◇"; rule "→I"; rule GEN)
5407    AOT_modally_strict {
5408      fix x
5409      AOT_assume 0: ψ
5410      AOT_have z ([F]z & ψ)  ¬ψ]x  (([F]x & ψ)  ¬ψ)
5411        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5412      also AOT_have ...  [F]x
5413        apply (rule "≡I"; rule "→I")
5414        using  "∨E"(3)[rotated, OF "useful-tautologies:2"[THEN "→E"], OF 0] "&E" apply blast
5415        apply (rule "∨I"(1)) using 0 "&I" by blast
5416      finally AOT_show [F]x  z ([F]z & ψ)  ¬ψ]x
5417        using "Commutativity of ≡"[THEN "≡E"(1)] by blast
5418    }
5419  qed
5420
5421  AOT_have Aux_C:  𝒜¬ψ  𝒜¬z(z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z) for ψ
5422  proof(rule "act-cond"[THEN "→E"]; rule "RA[2]"; rule "→I"; rule "raa-cor:2")
5423  AOT_modally_strict {
5424      AOT_assume 0: ¬ψ
5425      AOT_assume z (z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z)
5426      AOT_hence z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5427      moreover AOT_have z [F]z & ψ]z  [F]z & ψ for z
5428          by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5429      moreover AOT_have z ([F]z & ψ)  ¬ψ]z  (([F]z & ψ)  ¬ψ) for z
5430        by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5431      ultimately AOT_have [F]z & ψ  (([F]z & ψ)  ¬ψ) for z
5432        using "Commutativity of ≡"[THEN "≡E"(1)] "≡E"(5) by meson
5433      moreover AOT_have (([F]z & ψ)  ¬ψ) for z using 0 "∨I" by blast
5434      ultimately AOT_have ψ using "≡E" "&E" by metis
5435      AOT_thus ψ & ¬ψ using 0 "&I" by blast
5436    }
5437  qed
5438
5439  AOT_have Aux_D: 𝒜z ([F]z  z [F]z & ψ]z)  (𝒜¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  𝒜¬x ([F]x  z [F]z & ψ  ¬ψ]x)) for ψ
5440  proof (rule "→I"; rule "Act-Basic:5"[THEN "≡E"(1)])
5441    AOT_assume 𝒜z ([F]z  z [F]z & ψ]z)
5442    AOT_thus 𝒜(¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x))
5443    proof (rule "RA[3]"[where Γ="{«z ([F]z  z [F]z & ψ]z)»}", simplified, rotated])
5444      AOT_modally_strict {
5445        AOT_assume z ([F]z  z [F]z & ψ]z)
5446        AOT_thus ¬x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)  ¬x ([F]x  z [F]z & ψ  ¬ψ]x)
5447          apply -
5448        proof(rule "≡I"; (rule "useful-tautologies:5"[THEN "→E"]; rule "→I")?)
5449        AOT_modally_strict {
5450          AOT_assume z ([F]z  z [F]z & ψ]z)
5451          AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5452          AOT_assume x ([F]x  z [F]z & ψ  ¬ψ]x)
5453          AOT_hence 2: [F]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5454          AOT_have z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "≡E" 1 2 by meson
5455          AOT_thus x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5456        }
5457      next
5458        AOT_modally_strict {
5459          AOT_assume z ([F]z  z [F]z & ψ]z)
5460          AOT_hence 1: [F]z  z [F]z & ψ]z for z using "∀E" by blast
5461          AOT_assume x (z [F]z & ψ]x  z [F]z & ψ  ¬ψ]x)
5462          AOT_hence 2: z [F]z & ψ]z  z [F]z & ψ  ¬ψ]z for z using "∀E" by blast
5463          AOT_have [F]z  z [F]z & ψ  ¬ψ]z for z using 1 2 "≡E" by meson
5464          AOT_thus x ([F]x  z [F]z & ψ  ¬ψ]x) by (rule GEN)
5465        }
5466      qed
5467      }
5468    qed
5469  qed
5470
5471  AOT_have ¬𝒜q0
5472    apply (rule "=dfI"(2)[OF q0_def])
5473     apply (fact "log-prop-prop:2")
5474    by (fact AOT)
5475  AOT_hence q0_prop_1: 𝒜¬q0
5476    using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] by blast
5477  {
5478    AOT_assume 1: 𝒜x([F]x  z [F]z & q0]x)
5479    AOT_have 2: x([F]x  z [F]z & q0  ¬q0]x)
5480      using Aux_B[THEN "→E", OF q0_prop[THEN "&E"(1)]].
5481    AOT_have 𝒜¬x(z [F]z & q0]x  z [F]z & q0  ¬q0]x)
5482      using Aux_C[THEN "→E", OF q0_prop_1].
5483    AOT_hence 3: 𝒜¬x([F]x  z [F]z & q0  ¬q0]x)
5484      using Aux_D[THEN "→E", OF 1, THEN "≡E"(1)] by blast
5485    AOT_hence 𝒜¬x([F]x  z [F]z & q0  ¬q0]x) & x([F]x  z [F]z & q0  ¬q0]x) using 2 "&I" by blast
5486    AOT_hence G (𝒜¬x ([F]x  [G]x) & x([F]x  [G]x))
5487      by (rule "∃I"(1)) "cqt:2[lambda]"
5488  }
5489  moreover {
5490    AOT_assume 2: ¬𝒜x([F]x  z [F]z & q0]x)
5491    AOT_hence 𝒜¬x([F]x  z [F]z & q0]x)
5492      using "logic-actual-nec:1"[axiom_inst, THEN "≡E"(2)] by blast
5493    AOT_hence 𝒜¬x ([F]x  z [F]z & q0]x) & x([F]x  z [F]z & q0]x)
5494      using Aux_A[THEN "→E", OF q0_prop[THEN "&E"(1)]] "&I" by blast
5495    AOT_hence G (𝒜¬x ([F]x  [G]x) & x([F]x  [G]x))
5496      by (rule "∃I"(1)) "cqt:2[lambda]"
5497  }
5498  ultimately AOT_show G (𝒜¬x ([F]x  [G]x) & x([F]x  [G]x))
5499    using "∨E"(1)[OF "exc-mid"] "→I" by blast
5500qed
5501
5502AOT_theorem "oa-contingent:1": O!  A!
5503proof(rule "≡dfI"[OF "=-infix"]; rule "raa-cor:2")
5504  fix x
5505  AOT_assume 1: O! = A!
5506  AOT_hence x E!x] = A!
5507    by (rule "=dfE"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
5508  AOT_hence x E!x] = x ¬E!x]
5509    by (rule "=dfE"(2)[OF AOT_abstract, rotated]) "cqt:2[lambda]"
5510  moreover AOT_have x E!x]x  E!x
5511    by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5512  ultimately AOT_have x ¬E!x]x  E!x
5513    using "rule=E" by fast
5514  moreover AOT_have x ¬E!x]x  ¬E!x
5515    by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5516  ultimately AOT_have E!x  ¬E!x using "≡E"(6) "Commutativity of ≡"[THEN "≡E"(1)] by blast
5517  AOT_thus "(E!x  ¬E!x) & ¬(E!x  ¬E!x)" using "oth-class-taut:3:c" "&I" by blast
5518qed
5519
5520AOT_theorem "oa-contingent:2": O!x  ¬A!x
5521proof -
5522  AOT_have O!x  x E!x]x
5523    apply (rule "≡I"; rule "→I")
5524     apply (rule "=dfE"(2)[OF AOT_ordinary])
5525      apply "cqt:2[lambda]"
5526     apply argo
5527    apply (rule  "=dfI"(2)[OF AOT_ordinary])
5528     apply "cqt:2[lambda]"
5529    by argo
5530  also AOT_have   E!x
5531    by (rule "beta-C-meta"[THEN "→E"]) "cqt:2[lambda]"
5532  also AOT_have   ¬¬E!x
5533    using "oth-class-taut:3:b".
5534  also AOT_have   ¬x ¬E!x]x
5535    by (rule "beta-C-meta"[THEN "→E", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], symmetric]) "cqt:2[lambda]"
5536  also AOT_have   ¬A!x
5537    apply (rule "≡I"; rule "→I")
5538     apply (rule "=dfI"(2)[OF AOT_abstract])
5539      apply "cqt:2[lambda]"
5540     apply argo
5541    apply (rule "=dfE"(2)[OF AOT_abstract])
5542     apply "cqt:2[lambda]"
5543    by argo
5544  finally show ?thesis.
5545qed
5546
5547AOT_theorem "oa-contingent:3": A!x  ¬O!x
5548  by (AOT_subst A!x ¬¬A!x)
5549     (auto simp add: "oth-class-taut:3:b" "oa-contingent:2"[THEN "oth-class-taut:4:b"[THEN "≡E"(1)], symmetric])
5550
5551AOT_theorem "oa-contingent:4": Contingent(O!)
5552proof (rule "thm-cont-prop:2"[unvarify F, OF "oa-exist:1", THEN "≡E"(2)]; rule "&I")
5553  AOT_have x E!x using "thm-cont-e:3" .
5554  AOT_hence x E!x using "BF◇"[THEN "→E"] by blast
5555  then AOT_obtain a where E!a using "∃E"[rotated] by blast
5556  AOT_hence x E!x]a
5557    by (rule "beta-C-meta"[THEN "→E", THEN "≡E"(2), rotated]) "cqt:2[lambda]"
5558  AOT_hence O!a
5559    by (rule "=dfI"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
5560  AOT_hence x O!x using "∃I" by blast
5561  AOT_thus x O!x using "T◇"[THEN "→E"] by blast
5562next
5563  AOT_obtain a where A!a
5564    using "A-objects"[axiom_inst] "∃E"[rotated] "&E" by blast
5565  AOT_hence ¬O!a using "oa-contingent:3"[THEN "≡E"(1)] by blast
5566  AOT_hence x ¬O!x using "∃I" by fast
5567  AOT_thus x ¬O!x using "T◇"[THEN "→E"] by blast
5568qed
5569
5570AOT_theorem "oa-contingent:5": Contingent(A!)
5571proof (rule "thm-cont-prop:2"[unvarify F, OF "oa-exist:2", THEN "≡E"(2)]; rule "&I")
5572  AOT_obtain a where A!a
5573    using "A-objects"[axiom_inst] "∃E"[rotated] "&E" by blast
5574  AOT_hence x A!x using "∃I" by fast
5575  AOT_thus x A!x using "T◇"[THEN "→E"] by blast
5576next
5577  AOT_have x E!x using "thm-cont-e:3" .
5578  AOT_hence x E!x using "BF◇"[THEN "→E"] by blast
5579  then AOT_obtain a where E!a using "∃E"[rotated] by blast
5580  AOT_hence x E!x]a
5581    by (rule "beta-C-meta"[THEN "→E", THEN "≡E"(2), rotated]) "cqt:2[lambda]"
5582  AOT_hence O!a
5583    by (rule "=dfI"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
5584  AOT_hence ¬A!a using "oa-contingent:2"[THEN "≡E"(1)] by blast
5585  AOT_hence x ¬A!x using "∃I" by fast
5586  AOT_thus x ¬A!x using "T◇"[THEN "→E"] by blast
5587qed
5588
5589AOT_theorem "oa-contingent:7": O!-x  ¬A!-x
5590proof -
5591  AOT_have O!x  ¬A!x
5592    using "oa-contingent:2" by blast
5593  also AOT_have   A!-x
5594    using "thm-relation-negation:1"[symmetric, unvarify F, OF "oa-exist:2"].
5595  finally AOT_have 1: O!x  A!-x.
5596
5597  AOT_have A!x  ¬O!x
5598    using "oa-contingent:3" by blast
5599  also AOT_have   O!-x
5600    using "thm-relation-negation:1"[symmetric, unvarify F, OF "oa-exist:1"].
5601  finally AOT_have 2: A!x  O!-x.
5602
5603  AOT_show O!-x  ¬A!-x
5604    using 1[THEN "oth-class-taut:4:b"[THEN "≡E"(1)]] "oa-contingent:3"[of _ x] 2[symmetric]
5605          "≡E"(5) by blast
5606qed
5607
5608AOT_theorem "oa-contingent:6": O!-  A!-
5609proof (rule "=-infix"[THEN "≡dfI"]; rule "raa-cor:2")
5610  AOT_assume 1: O!- = A!-
5611  fix x
5612  AOT_have A!-x  O!-x
5613    apply (rule "rule=E"[rotated, OF 1]) by (fact "oth-class-taut:3:a")
5614  AOT_hence A!-x  ¬A!-x
5615    using "oa-contingent:7" "≡E" by fast
5616  AOT_thus (A!-x  ¬A!-x) & ¬(A!-x  ¬A!-x) using "oth-class-taut:3:c" "&I" by blast
5617qed
5618
5619AOT_theorem "oa-contingent:8": Contingent(O!-)
5620  using "thm-cont-prop:3"[unvarify F, OF "oa-exist:1", THEN "≡E"(1), OF "oa-contingent:4"].
5621
5622AOT_theorem "oa-contingent:9": Contingent(A!-)
5623  using "thm-cont-prop:3"[unvarify F, OF "oa-exist:2", THEN "≡E"(1), OF "oa-contingent:5"].
5624
5625AOT_define WeaklyContingent :: ‹Π  φ› ("WeaklyContingent'(_')")
5626  "df-cont-nec": "WeaklyContingent([F]) df Contingent([F]) & x ([F]x  [F]x)"
5627
5628AOT_theorem "cont-nec-fact1:1": WeaklyContingent([F])  WeaklyContingent([F]-)
5629proof -
5630  AOT_have WeaklyContingent([F])  Contingent([F]) & x ([F]x  [F]x)
5631    using "df-cont-nec"[THEN "≡Df"] by blast
5632  also AOT_have ...  Contingent([F]-) & x ([F]x  [F]x)
5633    apply (rule "oth-class-taut:8:f"[THEN "≡E"(2)]; rule "→I")
5634    using "thm-cont-prop:3".
5635  also AOT_have   Contingent([F]-) & x ([F]-x  [F]-x)
5636  proof (rule "oth-class-taut:8:e"[THEN "≡E"(2)]; rule "→I"; rule "≡I"; rule "→I"; rule GEN; rule "→I")
5637    fix x
5638    AOT_assume 0: x ([F]x  [F]x)
5639    AOT_assume 1: [F]-x
5640    AOT_have ¬[F]x
5641      by (AOT_subst (reverse) ¬[F]x [F]-x)
5642         (auto simp add: "thm-relation-negation:1" 1)
5643    AOT_hence 2: ¬[F]x
5644      using "KBasic:11"[THEN "≡E"(2)] by blast
5645    AOT_show [F]-x
5646    proof (rule "raa-cor:1")
5647      AOT_assume 3: ¬[F]-x
5648      AOT_have ¬¬[F]x
5649        by (AOT_subst (reverse) ¬[F]x [F]-x)
5650           (auto simp add: "thm-relation-negation:1" 3)
5651      AOT_hence [F]x
5652        using "conventions:5"[THEN "≡dfI"] by simp
5653      AOT_hence [F]x using 0 "∀E" "→E" by fast
5654      AOT_thus [F]x & ¬[F]x using "&I" 2 by blast
5655    qed
5656  next
5657    fix x
5658    AOT_assume 0: x ([F]-x  [F]-x)
5659    AOT_assume 1: [F]x
5660    AOT_have ¬[F]-x
5661      by (AOT_subst ¬[F]-x [F]x)
5662         (auto simp: "thm-relation-negation:2" 1)
5663    AOT_hence 2: ¬[F]-x
5664      using "KBasic:11"[THEN "≡E"(2)] by blast
5665    AOT_show [F]x
5666    proof (rule "raa-cor:1")
5667      AOT_assume 3: ¬[F]x
5668      AOT_have ¬¬[F]-x
5669        by (AOT_subst ¬[F]-x [F]x)
5670           (auto simp add: "thm-relation-negation:2" 3)
5671      AOT_hence [F]-x
5672        using "conventions:5"[THEN "≡dfI"] by simp
5673      AOT_hence [F]-x using 0 "∀E" "→E" by fast
5674      AOT_thus [F]-x & ¬[F]-x using "&I" 2 by blast
5675    qed
5676  qed
5677  also AOT_have   WeaklyContingent([F]-)
5678    using "df-cont-nec"[THEN "≡Df", symmetric] by blast
5679  finally show ?thesis.
5680qed
5681
5682AOT_theorem "cont-nec-fact1:2": (WeaklyContingent([F]) & ¬WeaklyContingent([G]))  F  G
5683proof (rule "→I"; rule "=-infix"[THEN "≡dfI"]; rule "raa-cor:2")
5684  AOT_assume 1: WeaklyContingent([F]) & ¬WeaklyContingent([G])
5685  AOT_hence WeaklyContingent([F]) using "&E" by blast
5686  moreover AOT_assume F = G
5687  ultimately AOT_have WeaklyContingent([G])
5688    using "rule=E" by blast
5689  AOT_thus WeaklyContingent([G]) & ¬WeaklyContingent([G])
5690    using 1 "&I" "&E" by blast
5691qed
5692
5693AOT_theorem "cont-nec-fact2:1": WeaklyContingent(O!)
5694proof (rule "df-cont-nec"[THEN "≡dfI"]; rule "&I")
5695  AOT_show Contingent(O!)
5696    using "oa-contingent:4".
5697next
5698  AOT_show x ([O!]x  [O!]x)
5699    apply (rule GEN; rule "→I")
5700    using "oa-facts:5"[THEN "≡E"(1)] by blast
5701qed
5702
5703
5704AOT_theorem "cont-nec-fact2:2": WeaklyContingent(A!)
5705proof (rule "df-cont-nec"[THEN "≡dfI"]; rule "&I")
5706  AOT_show Contingent(A!)
5707    using "oa-contingent:5".
5708next
5709  AOT_show x ([A!]x  [A!]x)
5710    apply (rule GEN; rule "→I")
5711    using "oa-facts:6"[THEN "≡E"(1)] by blast
5712qed
5713
5714AOT_theorem "cont-nec-fact2:3": ¬WeaklyContingent(E!)
5715proof (rule "df-cont-nec"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)];
5716       rule DeMorgan(1)[THEN "≡E"(2)]; rule "∨I"(2); rule "raa-cor:2")
5717  AOT_have x (E!x & ¬𝒜E!x) using "qml:4"[axiom_inst].
5718  AOT_hence x (E!x & ¬𝒜E!x) using "BF◇"[THEN "→E"] by blast
5719  then AOT_obtain a where (E!a & ¬𝒜E!a) using "∃E"[rotated] by blast
5720  AOT_hence 1: E!a & ¬𝒜E!a using "KBasic2:3"[THEN "→E"] by simp
5721  moreover AOT_assume x ([E!]x  [E!]x)
5722  ultimately AOT_have E!a using "&E" "∀E" "→E" by fast
5723  AOT_hence 𝒜E!a using "nec-imp-act"[THEN "→E"] by blast
5724  AOT_hence 𝒜E!a using "qml-act:1"[axiom_inst, THEN "→E"] by blast
5725  moreover AOT_have ¬𝒜E!a using "KBasic:11"[THEN "≡E"(2)] 1[THEN "&E"(2)] by meson
5726  ultimately AOT_have 𝒜E!a & ¬𝒜E!a using "&I" by blast
5727  AOT_thus p & ¬p for p using "raa-cor:1" by blast
5728qed
5729
5730AOT_theorem "cont-nec-fact2:4": ¬WeaklyContingent(L)
5731  apply (rule "df-cont-nec"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)];
5732       rule DeMorgan(1)[THEN "≡E"(2)]; rule "∨I"(1))
5733  apply (rule "contingent-properties:4"[THEN "≡Df", THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(2)])
5734  apply (rule DeMorgan(1)[THEN "≡E"(2)]; rule "∨I"(2); rule "useful-tautologies:2"[THEN "→E"])
5735  using "thm-noncont-e-e:3"[THEN "contingent-properties:3"[THEN "≡dfE"]].
5736
5737(* TODO: cleanup *)
5738AOT_theorem "cont-nec-fact2:5": O!  E! & O!  E!- & O!  L & O!  L-
5739proof -
5740  AOT_have 1: L
5741    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5742  {
5743    fix φ and Π Π' :: <κ>
5744    AOT_have A: ¬(φ{Π'}  φ{Π}) if  φ{Π} and ¬φ{Π'}
5745    proof (rule "raa-cor:2")
5746      AOT_assume φ{Π'}  φ{Π}
5747      AOT_hence φ{Π'} using that(1) "≡E" by blast
5748      AOT_thus φ{Π'} & ¬φ{Π'} using that(2) "&I" by blast
5749    qed
5750    AOT_have Π'  Π if Π and Π' and φ{Π} and ¬φ{Π'}
5751      using "pos-not-equiv-ne:4"[unvarify F G, THEN "→E", OF that(1,2), OF A[OF that(3, 4)]].
5752  } note 0 = this
5753  show ?thesis
5754    apply(safe intro!: "&I"; rule 0)
5755    using "cqt:2[concrete]"[axiom_inst] apply blast
5756    using "oa-exist:1" apply blast
5757    using "cont-nec-fact2:3" apply fast
5758    apply (rule "useful-tautologies:2"[THEN "→E"])
5759    using "cont-nec-fact2:1" apply fast
5760    using "rel-neg-T:3" apply fast
5761    using "oa-exist:1" apply blast
5762    using "cont-nec-fact1:1"[unvarify F, THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated, OF "cont-nec-fact2:3", OF "cqt:2[concrete]"[axiom_inst]] apply fast
5763    apply (rule "useful-tautologies:2"[THEN "→E"])
5764    using "cont-nec-fact2:1" apply blast
5765    apply (rule "=dfI"(2)[OF L_def]; "cqt:2[lambda]")
5766    using "oa-exist:1" apply fast
5767    using "cont-nec-fact2:4" apply fast
5768    apply (rule "useful-tautologies:2"[THEN "→E"])
5769    using "cont-nec-fact2:1" apply fast
5770    using "rel-neg-T:3" apply fast
5771    using "oa-exist:1" apply fast
5772    apply (rule "cont-nec-fact1:1"[unvarify F, THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated, OF "cont-nec-fact2:4"])
5773    apply (rule "=dfI"(2)[OF L_def]; "cqt:2[lambda]")
5774    apply (rule "useful-tautologies:2"[THEN "→E"])
5775    using "cont-nec-fact2:1" by blast
5776qed
5777
5778(* TODO: cleanup together with above *)
5779AOT_theorem "cont-nec-fact2:6": A!  E! & A!  E!- & A!  L & A!  L-
5780proof -
5781  AOT_have 1: L
5782    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
5783  {
5784    fix φ and Π Π' :: <κ>
5785    AOT_have A: ¬(φ{Π'}  φ{Π}) if  φ{Π} and ¬φ{Π'}
5786    proof (rule "raa-cor:2")
5787      AOT_assume φ{Π'}  φ{Π}
5788      AOT_hence φ{Π'} using that(1) "≡E" by blast
5789      AOT_thus φ{Π'} & ¬φ{Π'} using that(2) "&I" by blast
5790    qed
5791    AOT_have Π'  Π if Π and Π' and φ{Π} and ¬φ{Π'}
5792      using "pos-not-equiv-ne:4"[unvarify F G, THEN "→E", OF that(1,2), OF A[OF that(3, 4)]].
5793  } note 0 = this
5794  show ?thesis
5795    apply(safe intro!: "&I"; rule 0)
5796    using "cqt:2[concrete]"[axiom_inst] apply blast
5797    using "oa-exist:2" apply blast
5798    using "cont-nec-fact2:3" apply fast
5799    apply (rule "useful-tautologies:2"[THEN "→E"])
5800    using "cont-nec-fact2:2" apply fast
5801    using "rel-neg-T:3" apply fast
5802    using "oa-exist:2" apply blast
5803    using "cont-nec-fact1:1"[unvarify F, THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated, OF "cont-nec-fact2:3", OF "cqt:2[concrete]"[axiom_inst]] apply fast
5804    apply (rule "useful-tautologies:2"[THEN "→E"])
5805    using "cont-nec-fact2:2" apply blast
5806    apply (rule "=dfI"(2)[OF L_def]; "cqt:2[lambda]")
5807    using "oa-exist:2" apply fast
5808    using "cont-nec-fact2:4" apply fast
5809    apply (rule "useful-tautologies:2"[THEN "→E"])
5810    using "cont-nec-fact2:2" apply fast
5811    using "rel-neg-T:3" apply fast
5812    using "oa-exist:2" apply fast
5813    apply (rule "cont-nec-fact1:1"[unvarify F, THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated, OF "cont-nec-fact2:4"])
5814    apply (rule "=dfI"(2)[OF L_def]; "cqt:2[lambda]")
5815    apply (rule "useful-tautologies:2"[THEN "→E"])
5816    using "cont-nec-fact2:2" by blast
5817qed
5818
5819AOT_define necessary_or_contingently_false :: ‹φ  φ› ("Δ_" [49] 54)
5820  Δp df p  (¬𝒜p & p)
5821
5822AOT_theorem sixteen:
5823 shows F1F2F3F4F5F6F7F8F9F10F11F12F13F14F15F16 (
5824«F1::<κ>»  F2 & F1  F3 & F1  F4 & F1  F5 & F1  F6 & F1  F7 & F1  F8 & F1  F9 & F1  F10 & F1  F11 & F1  F12 & F1  F13 & F1  F14 & F1  F15 & F1  F16 &
5825F2  F3 & F2  F4 & F2  F5 & F2  F6 & F2  F7 & F2  F8 & F2  F9 & F2  F10 & F2  F11 & F2  F12 & F2  F13 & F2  F14 & F2  F15 & F2  F16 &
5826F3  F4 & F3  F5 & F3  F6 & F3  F7 & F3  F8 & F3  F9 & F3  F10 & F3  F11 & F3  F12 & F3  F13 & F3  F14 & F3  F15 & F3  F16 &
5827F4  F5 & F4  F6 & F4  F7 & F4  F8 & F4  F9 & F4  F10 & F4  F11 & F4  F12 & F4  F13 & F4  F14 & F4  F15 & F4  F16 &
5828F5  F6 & F5  F7 & F5  F8 & F5  F9 & F5  F10 & F5  F11 & F5  F12 & F5  F13 & F5  F14 & F5  F15 & F5  F16 &
5829F6  F7 & F6  F8 & F6  F9 & F6  F10 & F6  F11 & F6  F12 & F6  F13 & F6  F14 & F6  F15 & F6  F16 &
5830F7  F8 & F7  F9 & F7  F10 & F7  F11 & F7  F12 & F7  F13 & F7  F14 & F7  F15 & F7  F16 &
5831F8  F9 & F8  F10 & F8  F11 & F8  F12 & F8  F13 & F8  F14 & F8  F15 & F8  F16 &
5832F9  F10 & F9  F11 & F9  F12 & F9  F13 & F9  F14 & F9  F15 & F9  F16 &
5833F10  F11 & F10  F12 & F10  F13 & F10  F14 & F10  F15 & F10  F16 &
5834F11  F12 & F11  F13 & F11  F14 & F11  F15 & F11  F16 &
5835F12  F13 & F12  F14 & F12  F15 & F12  F16 &
5836F13  F14 & F13  F15 & F13  F16 &
5837F14  F15 & F14  F16 &
5838F15  F16) 
5839proof -
5840
5841  AOT_have Delta_pos: Δφ  φ for φ
5842  proof(rule "→I")
5843    AOT_assume Δφ
5844    AOT_hence φ  (¬𝒜φ & φ)
5845      using "≡dfE"[OF necessary_or_contingently_false] by blast
5846    moreover {
5847      AOT_assume φ
5848      AOT_hence φ
5849        by (metis "B◇" "T◇" "vdash-properties:10")
5850    }
5851    moreover {
5852      AOT_assume ¬𝒜φ & φ
5853      AOT_hence φ
5854        using "&E" by blast
5855    }
5856    ultimately AOT_show φ
5857      by (metis "∨E"(2) "raa-cor:1") 
5858  qed
5859
5860  AOT_have act_and_not_nec_not_delta: ¬Δφ if 𝒜φ and ¬φ for φ
5861    using "≡dfE" "&E"(1) "∨E"(2) necessary_or_contingently_false "raa-cor:3" that(1) that(2) by blast
5862  AOT_have act_and_pos_not_not_delta: ¬Δφ if 𝒜φ and ¬φ for φ
5863    using "KBasic:11" act_and_not_nec_not_delta "≡E"(2) that(1) that(2) by blast
5864  AOT_have impossible_delta: ¬Δφ if ¬φ for φ
5865    using Delta_pos "modus-tollens:1" that by blast
5866  AOT_have not_act_and_pos_delta: Δφ if ¬𝒜φ and φ for φ
5867    by (meson "≡dfI" "&I" "∨I"(2) necessary_or_contingently_false that(1) that(2))
5868  AOT_have nec_delta: Δφ if φ for φ
5869    using "≡dfI" "∨I"(1) necessary_or_contingently_false that by blast
5870
5871  AOT_obtain a where a_prop: A!a
5872    using "A-objects"[axiom_inst] "∃E"[rotated] "&E" by blast
5873  AOT_obtain b where b_prop: [E!]b & ¬𝒜[E!]b
5874    using "pos-not-pna:3" using "∃E"[rotated] by blast
5875
5876  AOT_have b_ord: [O!]b
5877  proof(rule "=dfI"(2)[OF AOT_ordinary])
5878    AOT_show x [E!]x] by "cqt:2[lambda]"
5879  next
5880    AOT_show x [E!]x]b
5881    proof (rule "β←C"(1); ("cqt:2[lambda]")?)
5882      AOT_show b by (rule "cqt:2[const_var]"[axiom_inst])
5883      AOT_show [E!]b by (fact b_prop[THEN "&E"(1)])
5884    qed
5885  qed
5886
5887  AOT_have nec_not_L_neg: ¬[L-]x for x
5888    using "thm-noncont-e-e:2" "contingent-properties:2"[THEN "≡dfE"] "&E"
5889          CBF[THEN "→E"] "∀E" by blast
5890  AOT_have nec_L: [L]x for x
5891    using "thm-noncont-e-e:1" "contingent-properties:1"[THEN "≡dfE"]
5892      CBF[THEN "→E"] "∀E" by blast
5893
5894  AOT_have act_ord_b: 𝒜[O!]b
5895    using b_ord "≡E"(1) "oa-facts:7" by blast
5896  AOT_have delta_ord_b: Δ[O!]b
5897    by (meson "≡dfI" b_ord "∨I"(1) necessary_or_contingently_false "oa-facts:1" "vdash-properties:10")
5898  AOT_have not_act_ord_a: ¬𝒜[O!]a
5899    by (meson a_prop "≡E"(1) "≡E"(3) "oa-contingent:3" "oa-facts:7")
5900  AOT_have not_delta_ord_a: ¬Δ[O!]a
5901    by (metis Delta_pos "≡E"(4) not_act_ord_a "oa-facts:3" "oa-facts:7" "reductio-aa:1" "vdash-properties:10")
5902
5903  AOT_have not_act_abs_b: ¬𝒜[A!]b
5904    by (meson b_ord "≡E"(1) "≡E"(3) "oa-contingent:2" "oa-facts:8")
5905  AOT_have not_delta_abs_b: ¬Δ[A!]b
5906  proof(rule "raa-cor:2")
5907    AOT_assume Δ[A!]b
5908    AOT_hence [A!]b
5909      by (metis Delta_pos "vdash-properties:10")
5910    AOT_thus [A!]b & ¬[A!]b
5911      by (metis b_ord "&I" "≡E"(1) "oa-contingent:2" "oa-facts:4" "vdash-properties:10")
5912  qed
5913  AOT_have act_abs_a: 𝒜[A!]a
5914    using a_prop "≡E"(1) "oa-facts:8" by blast
5915  AOT_have delta_abs_a: Δ[A!]a
5916      by (metis "≡dfI" a_prop "oa-facts:2" "vdash-properties:10" "∨I"(1) necessary_or_contingently_false)
5917
5918  AOT_have not_act_concrete_b: ¬𝒜[E!]b
5919    using b_prop "&E"(2) by blast
5920  AOT_have delta_concrete_b: Δ[E!]b
5921  proof (rule "≡dfI"[OF necessary_or_contingently_false]; rule "∨I"(2); rule "&I")
5922    AOT_show ¬𝒜[E!]b using b_prop "&E"(2) by blast
5923  next
5924    AOT_show [E!]b using b_prop "&E"(1) by blast
5925  qed
5926  AOT_have not_act_concrete_a: ¬𝒜[E!]a
5927  proof (rule "raa-cor:2")
5928    AOT_assume 𝒜[E!]a
5929    AOT_hence 1: [E!]a by (metis "Act-Sub:3" "vdash-properties:10")
5930    AOT_have [A!]a by (simp add: a_prop)
5931    AOT_hence x ¬[E!]x]a
5932      by (rule "=dfE"(2)[OF AOT_abstract, rotated]) "cqt:2[lambda]"
5933    AOT_hence ¬[E!]a using "β→C"(1) by blast
5934    AOT_thus [E!]a & ¬[E!]a using 1 "&I" by blast
5935  qed
5936  AOT_have not_delta_concrete_a: ¬Δ[E!]a
5937  proof (rule "raa-cor:2")
5938    AOT_assume Δ[E!]a
5939    AOT_hence 1: [E!]a by (metis Delta_pos "vdash-properties:10")
5940    AOT_have [A!]a by (simp add: a_prop)
5941    AOT_hence x ¬[E!]x]a
5942      by (rule "=dfE"(2)[OF AOT_abstract, rotated]) "cqt:2[lambda]"
5943    AOT_hence ¬[E!]a using "β→C"(1) by blast
5944    AOT_thus [E!]a & ¬[E!]a using 1 "&I" by blast
5945  qed
5946
5947  AOT_have not_act_q_zero: ¬𝒜q0
5948    by (meson "log-prop-prop:2" "pos-not-pna:1" q0_def "reductio-aa:1" "rule-id-df:2:a[zero]")
5949  AOT_have delta_q_zero: Δq0
5950  proof(rule "≡dfI"[OF necessary_or_contingently_false]; rule "∨I"(2); rule "&I")
5951    AOT_show ¬𝒜q0 using not_act_q_zero.
5952    AOT_show q0 by (meson "&E"(1) q0_prop)
5953  qed
5954  AOT_have act_not_q_zero: 𝒜¬q0 using "Act-Basic:1" "∨E"(2) not_act_q_zero by blast
5955  AOT_have not_delta_not_q_zero: ¬Δ¬q0
5956      using "≡dfE" "conventions:5" "Act-Basic:1" act_and_not_nec_not_delta "&E"(1) "∨E"(2) not_act_q_zero q0_prop by blast
5957
5958  AOT_have [L-] by (simp add: "rel-neg-T:3")
5959  moreover AOT_have ¬𝒜[L-]b & ¬Δ[L-]b & ¬𝒜[L-]a & ¬Δ[L-]a
5960  proof (safe intro!: "&I")
5961    AOT_show ¬𝒜[L-]b by (meson "≡E"(1) "logic-actual-nec:1"[axiom_inst] "nec-imp-act" nec_not_L_neg "→E")
5962    AOT_show ¬Δ[L-]b by (meson Delta_pos "KBasic2:1" "≡E"(1) "modus-tollens:1" nec_not_L_neg)
5963    AOT_show ¬𝒜[L-]a by (meson "≡E"(1) "logic-actual-nec:1"[axiom_inst] "nec-imp-act" nec_not_L_neg "→E")
5964    AOT_show ¬Δ[L-]a using Delta_pos "KBasic2:1" "≡E"(1) "modus-tollens:1" nec_not_L_neg by blast
5965  qed
5966  ultimately AOT_obtain F0 where ¬𝒜[F0]b & ¬Δ[F0]b & ¬𝒜[F0]a & ¬Δ[F0]a
5967    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
5968  AOT_hence ¬𝒜[F0]b and ¬Δ[F0]b and ¬𝒜[F0]a and ¬Δ[F0]a
5969    using "&E" by blast+
5970  note props = this
5971
5972  let  = "«y [A!]y & q0]»"
5973  AOT_modally_strict {
5974    AOT_have [«»] by "cqt:2[lambda]"
5975  } note 1 = this
5976  moreover AOT_have¬𝒜[«»]b & ¬Δ[«»]b & ¬𝒜[«»]a & Δ[«»]a
5977  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
5978    AOT_show ¬𝒜([A!]b & q0)
5979      using "Act-Basic:2" "&E"(1) "≡E"(1) not_act_abs_b "raa-cor:3" by blast
5980  next AOT_show ¬Δ([A!]b & q0)
5981      by (metis Delta_pos "KBasic2:3" "&E"(1) "≡E"(4) not_act_abs_b "oa-facts:4" "oa-facts:8" "raa-cor:3" "vdash-properties:10")
5982  next AOT_show ¬𝒜([A!]a & q0)
5983      using "Act-Basic:2" "&E"(2) "≡E"(1) not_act_q_zero "raa-cor:3" by blast
5984  next AOT_show Δ([A!]a & q0)
5985    proof (rule not_act_and_pos_delta)
5986      AOT_show ¬𝒜([A!]a & q0)
5987        using "Act-Basic:2" "&E"(2) "≡E"(4) not_act_q_zero "raa-cor:3" by blast
5988    next AOT_show ([A!]a & q0)
5989        by (metis "&I" "→E" Delta_pos "KBasic:16" "&E"(1) delta_abs_a "≡E"(1) "oa-facts:6" q0_prop)
5990    qed
5991  qed
5992  ultimately AOT_obtain F1 where ¬𝒜[F1]b & ¬Δ[F1]b & ¬𝒜[F1]a & Δ[F1]a
5993    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
5994  AOT_hence ¬𝒜[F1]b and ¬Δ[F1]b and ¬𝒜[F1]a and Δ[F1]a
5995    using "&E" by blast+
5996  note props = props this
5997
5998  let  = "«y [A!]y & ¬q0]»"
5999  AOT_modally_strict {
6000    AOT_have [«»] by "cqt:2[lambda]"
6001  } note 1 = this
6002  moreover AOT_have ¬𝒜[«»]b & ¬Δ[«»]b & 𝒜[«»]a & ¬Δ[«»]a
6003  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6004    AOT_show ¬𝒜([A!]b & ¬q0)
6005      using "Act-Basic:2" "&E"(1) "≡E"(1) not_act_abs_b "raa-cor:3" by blast
6006  next AOT_show ¬Δ([A!]b & ¬q0)
6007      by (meson "RM◇" Delta_pos "Conjunction Simplification"(1) "≡E"(4) "modus-tollens:1" not_act_abs_b "oa-facts:4" "oa-facts:8")
6008  next AOT_show 𝒜([A!]a & ¬q0)
6009      by (metis "Act-Basic:1" "Act-Basic:2" act_abs_a "&I" "∨E"(2) "≡E"(3) not_act_q_zero "raa-cor:3")
6010  next AOT_show ¬Δ([A!]a & ¬q0)
6011    proof (rule act_and_not_nec_not_delta)
6012      AOT_show 𝒜([A!]a & ¬q0)
6013        by (metis "Act-Basic:1" "Act-Basic:2" act_abs_a "&I" "∨E"(2) "≡E"(3) not_act_q_zero "raa-cor:3")
6014    next
6015      AOT_show ¬([A!]a & ¬q0)
6016        by (metis "KBasic2:1" "KBasic:3" "&E"(1) "&E"(2) "≡E"(4) q0_prop "raa-cor:3")
6017    qed
6018  qed
6019  ultimately AOT_obtain F2 where ¬𝒜[F2]b & ¬Δ[F2]b & 𝒜[F2]a & ¬Δ[F2]a
6020    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6021  AOT_hence ¬𝒜[F2]b and ¬Δ[F2]b and 𝒜[F2]a and ¬Δ[F2]a
6022    using "&E" by blast+
6023  note props = props this
6024
6025  AOT_have abstract_prop: ¬𝒜[A!]b & ¬Δ[A!]b & 𝒜[A!]a & Δ[A!]a
6026    using act_abs_a "&I" delta_abs_a not_act_abs_b not_delta_abs_b by presburger
6027  then AOT_obtain F3 where ¬𝒜[F3]b & ¬Δ[F3]b & 𝒜[F3]a & Δ[F3]a
6028    using "∃I"(1)[rotated, THEN "∃E"[rotated]] "oa-exist:2" by fastforce
6029  AOT_hence ¬𝒜[F3]b and ¬Δ[F3]b and 𝒜[F3]a and Δ[F3]a
6030    using "&E" by blast+
6031  note props = props this
6032
6033  AOT_have ¬𝒜[E!]b & Δ[E!]b & ¬𝒜[E!]a & ¬Δ[E!]a
6034    by (meson "&I" delta_concrete_b not_act_concrete_a not_act_concrete_b not_delta_concrete_a)
6035  then AOT_obtain F4 where ¬𝒜[F4]b & Δ[F4]b & ¬𝒜[F4]a & ¬Δ[F4]a
6036    using "cqt:2[concrete]"[axiom_inst] "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6037  AOT_hence ¬𝒜[F4]b and Δ[F4]b and ¬𝒜[F4]a and ¬Δ[F4]a
6038    using "&E" by blast+
6039  note props = props this
6040
6041  AOT_modally_strict {
6042    AOT_have y q0] by "cqt:2[lambda]"
6043  } note 1 = this
6044  moreover AOT_have ¬𝒜y q0]b & Δy q0]b & ¬𝒜y q0]a & Δy q0]a
6045    by (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6046       (auto simp: not_act_q_zero delta_q_zero)
6047  ultimately AOT_obtain F5 where ¬𝒜[F5]b & Δ[F5]b & ¬𝒜[F5]a & Δ[F5]a
6048    using "cqt:2[concrete]"[axiom_inst] "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6049  AOT_hence ¬𝒜[F5]b and Δ[F5]b and ¬𝒜[F5]a and Δ[F5]a
6050    using "&E" by blast+
6051  note props = props this
6052
6053  let  = "«y [E!]y  ([A!]y & ¬q0)]»"
6054  AOT_modally_strict {
6055    AOT_have [«»] by "cqt:2[lambda]"
6056  } note 1 = this
6057  moreover AOT_have ¬𝒜[«»]b & Δ[«»]b & 𝒜[«»]a & ¬Δ[«»]a
6058  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6059    AOT_have 𝒜¬([A!]b & ¬q0)
6060      by (metis "Act-Basic:1" "Act-Basic:2" abstract_prop "&E"(1) "∨E"(2)
6061                "≡E"(1) "raa-cor:3")
6062    moreover AOT_have ¬𝒜[E!]b
6063      using b_prop "&E"(2) by blast
6064    ultimately AOT_have 2: 𝒜(¬[E!]b & ¬([A!]b & ¬q0))
6065      by (metis "Act-Basic:2" "Act-Sub:1" "&I" "≡E"(3) "raa-cor:1")
6066    AOT_have 𝒜¬([E!]b  ([A!]b & ¬q0))
6067      by (AOT_subst ¬([E!]b  ([A!]b & ¬q0)) ¬[E!]b & ¬([A!]b & ¬q0))
6068         (auto simp: "oth-class-taut:5:d" 2)
6069    AOT_thus ¬𝒜([E!]b  ([A!]b & ¬q0))
6070      by (metis "¬¬I" "Act-Sub:1" "≡E"(4))
6071  next
6072    AOT_show Δ([E!]b  ([A!]b & ¬q0))
6073    proof (rule not_act_and_pos_delta)
6074      AOT_show ¬𝒜([E!]b  ([A!]b & ¬q0))
6075        by (metis "Act-Basic:2" "Act-Basic:9" "∨E"(2) "Conjunction Simplification"(1) "≡E"(4) "modus-tollens:1" not_act_abs_b not_act_concrete_b "raa-cor:3")
6076    next
6077      AOT_show ([E!]b  ([A!]b & ¬q0))
6078        using "KBasic2:2" b_prop "&E"(1) "∨I"(1) "≡E"(3) "raa-cor:3" by blast
6079    qed
6080  next AOT_show 𝒜([E!]a  ([A!]a & ¬q0))
6081      by (metis "Act-Basic:1" "Act-Basic:2" "Act-Basic:9" act_abs_a "&I" "∨I"(2) "∨E"(2) "≡E"(3) not_act_q_zero "raa-cor:1")
6082  next AOT_show ¬Δ([E!]a  ([A!]a & ¬q0))
6083    proof (rule act_and_not_nec_not_delta)
6084      AOT_show 𝒜([E!]a  ([A!]a & ¬q0))
6085        by (metis "Act-Basic:1" "Act-Basic:2" "Act-Basic:9" act_abs_a "&I" "∨I"(2) "∨E"(2) "≡E"(3) not_act_q_zero "raa-cor:1")
6086    next
6087      AOT_have ¬[E!]a
6088        by (metis "≡dfI" "conventions:5" "&I" "∨I"(2) necessary_or_contingently_false not_act_concrete_a not_delta_concrete_a "raa-cor:3")
6089      moreover AOT_have ¬([A!]a & ¬q0)
6090        by (metis "KBasic2:1" "KBasic:11" "KBasic:3" "&E"(1) "&E"(2) "≡E"(1) q0_prop "raa-cor:3")
6091      ultimately AOT_have (¬[E!]a & ¬([A!]a & ¬q0)) by (metis "KBasic:16" "&I" "vdash-properties:10")
6092      AOT_hence ¬([E!]a  ([A!]a & ¬q0))
6093        by (metis "RE◇" "≡E"(2) "oth-class-taut:5:d")
6094      AOT_thus ¬([E!]a  ([A!]a & ¬q0)) by (metis "KBasic:12" "≡E"(1) "raa-cor:3")
6095    qed
6096  qed
6097  ultimately AOT_obtain F6 where ¬𝒜[F6]b & Δ[F6]b & 𝒜[F6]a & ¬Δ[F6]a
6098    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6099  AOT_hence ¬𝒜[F6]b and Δ[F6]b and 𝒜[F6]a and ¬Δ[F6]a
6100    using "&E" by blast+
6101  note props = props this
6102
6103  let  = "«y [A!]y  [E!]y]»"
6104  AOT_modally_strict {
6105    AOT_have [«»] by "cqt:2[lambda]"
6106  } note 1 = this
6107  moreover AOT_have ¬𝒜[«»]b & Δ[«»]b & 𝒜[«»]a & Δ[«»]a
6108  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6109    AOT_show ¬𝒜([A!]b  [E!]b)
6110      using "Act-Basic:9" "∨E"(2) "≡E"(4) not_act_abs_b not_act_concrete_b "raa-cor:3" by blast
6111  next AOT_show Δ([A!]b  [E!]b)
6112    proof (rule not_act_and_pos_delta)
6113      AOT_show ¬𝒜([A!]b  [E!]b)
6114        using "Act-Basic:9" "∨E"(2) "≡E"(4) not_act_abs_b not_act_concrete_b "raa-cor:3" by blast
6115    next AOT_show ([A!]b  [E!]b)
6116        using "KBasic2:2" b_prop "&E"(1) "∨I"(2) "≡E"(2) by blast
6117    qed
6118  next AOT_show 𝒜([A!]a  [E!]a)
6119      by (meson "Act-Basic:9" act_abs_a "∨I"(1) "≡E"(2))
6120  next AOT_show Δ([A!]a  [E!]a)
6121    proof (rule nec_delta)
6122      AOT_show ([A!]a  [E!]a)
6123        by (metis "KBasic:15" act_abs_a act_and_not_nec_not_delta "Disjunction Addition"(1) delta_abs_a "raa-cor:3" "vdash-properties:10")
6124    qed
6125  qed
6126  ultimately AOT_obtain F7 where ¬𝒜[F7]b & Δ[F7]b & 𝒜[F7]a & Δ[F7]a
6127    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6128  AOT_hence ¬𝒜[F7]b and Δ[F7]b and 𝒜[F7]a and Δ[F7]a
6129    using "&E" by blast+
6130  note props = props this
6131
6132  let  = "«y [O!]y & ¬[E!]y]»"
6133  AOT_modally_strict {
6134    AOT_have [«»] by "cqt:2[lambda]"
6135  } note 1 = this
6136  moreover AOT_have 𝒜[«»]b & ¬Δ[«»]b & ¬𝒜[«»]a & ¬Δ[«»]a
6137  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6138    AOT_show 𝒜([O!]b & ¬[E!]b)
6139      by (metis "Act-Basic:1" "Act-Basic:2" act_ord_b "&I" "∨E"(2) "≡E"(3) not_act_concrete_b "raa-cor:3")
6140  next AOT_show ¬Δ([O!]b & ¬[E!]b)
6141      by (metis (no_types, hide_lams) "conventions:5" "Act-Sub:1" "RM:1" act_and_not_nec_not_delta "act-conj-act:3"
6142                act_ord_b b_prop "&I" "&E"(1) "Conjunction Simplification"(2) "df-rules-formulas[3]"
6143                "≡E"(3) "raa-cor:1" "→E")
6144  next AOT_show ¬𝒜([O!]a & ¬[E!]a)
6145      using "Act-Basic:2" "&E"(1) "≡E"(1) not_act_ord_a "raa-cor:3" by blast
6146  next AOT_have ¬([O!]a & ¬[E!]a)
6147      by (metis "KBasic2:3" "&E"(1) "≡E"(4) not_act_ord_a "oa-facts:3" "oa-facts:7" "raa-cor:3" "vdash-properties:10")
6148    AOT_thus ¬Δ([O!]a & ¬[E!]a)
6149      by (rule impossible_delta)
6150  qed      
6151  ultimately AOT_obtain F8 where 𝒜[F8]b & ¬Δ[F8]b & ¬𝒜[F8]a & ¬Δ[F8]a
6152    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6153  AOT_hence 𝒜[F8]b and ¬Δ[F8]b and ¬𝒜[F8]a and ¬Δ[F8]a
6154    using "&E" by blast+
6155  note props = props this
6156
6157  (* TODO_PLM: binary property 9 wrong in PLM *)
6158  let  = "«y ¬[E!]y & ([O!]y  q0)]»"
6159  AOT_modally_strict {
6160    AOT_have [«»] by "cqt:2[lambda]"
6161  } note 1 = this
6162  moreover AOT_have 𝒜[«»]b & ¬Δ[«»]b & ¬𝒜[«»]a & Δ[«»]a
6163  proof(safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6164    AOT_show 𝒜(¬[E!]b & ([O!]b  q0))
6165      by (metis "Act-Basic:1" "Act-Basic:2" "Act-Basic:9" act_ord_b "&I" "∨I"(1)
6166                "∨E"(2) "≡E"(3) not_act_concrete_b "raa-cor:1")
6167  next AOT_show ¬Δ(¬[E!]b & ([O!]b  q0))
6168    proof (rule act_and_pos_not_not_delta)
6169      AOT_show 𝒜(¬[E!]b & ([O!]b  q0))
6170        by (metis "Act-Basic:1" "Act-Basic:2" "Act-Basic:9" act_ord_b "&I" "∨I"(1)
6171                  "∨E"(2) "≡E"(3) not_act_concrete_b "raa-cor:1")
6172    next
6173      AOT_show ¬(¬[E!]b & ([O!]b  q0))
6174      proof (AOT_subst ¬(¬[E!]b & ([O!]b  q0)) [E!]b  ¬([O!]b  q0))
6175        AOT_modally_strict {
6176          AOT_show ¬(¬[E!]b & ([O!]b  q0))  [E!]b  ¬([O!]b  q0)
6177            by (metis "&I" "&E"(1) "&E"(2) "∨I"(1) "∨I"(2) "∨E"(2) "deduction-theorem" "≡I" "reductio-aa:1")
6178        }
6179      next
6180        AOT_show ([E!]b  ¬([O!]b  q0))
6181          using "KBasic2:2" b_prop "&E"(1) "∨I"(1) "≡E"(3) "raa-cor:3" by blast
6182       qed
6183     qed
6184   next
6185     AOT_show ¬𝒜(¬[E!]a & ([O!]a  q0))
6186       using "Act-Basic:2" "Act-Basic:9" "&E"(2) "∨E"(3) "≡E"(1) not_act_ord_a not_act_q_zero "reductio-aa:2" by blast
6187   next
6188     AOT_show Δ(¬[E!]a & ([O!]a  q0))
6189     proof (rule not_act_and_pos_delta)
6190       AOT_show ¬𝒜(¬[E!]a & ([O!]a  q0))
6191         by (metis "Act-Basic:2" "Act-Basic:9" "&E"(2) "∨E"(3) "≡E"(1) not_act_ord_a not_act_q_zero "reductio-aa:2")
6192     next
6193       AOT_have ¬[E!]a
6194         using "KBasic2:1" "≡E"(2) not_act_and_pos_delta not_act_concrete_a not_delta_concrete_a "raa-cor:5" by blast
6195       moreover AOT_have ([O!]a  q0)
6196         by (metis "KBasic2:2" "&E"(1) "∨I"(2) "≡E"(3) q0_prop "raa-cor:3")
6197       ultimately AOT_show (¬[E!]a & ([O!]a  q0))
6198         by (metis "KBasic:16" "&I" "vdash-properties:10")
6199     qed
6200   qed
6201  ultimately AOT_obtain F9 where 𝒜[F9]b & ¬Δ[F9]b & ¬𝒜[F9]a & Δ[F9]a
6202    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6203  AOT_hence 𝒜[F9]b and ¬Δ[F9]b and ¬𝒜[F9]a and Δ[F9]a
6204    using "&E" by blast+
6205  note props = props this
6206
6207  AOT_modally_strict {
6208    AOT_have y ¬q0] by "cqt:2[lambda]"
6209  } note 1 = this
6210  moreover AOT_have 𝒜y ¬q0]b & ¬Δy ¬q0]b & 𝒜y ¬q0]a & ¬Δy ¬q0]a
6211    by (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1]; auto simp: act_not_q_zero not_delta_not_q_zero)
6212  ultimately AOT_obtain F10 where 𝒜[F10]b & ¬Δ[F10]b & 𝒜[F10]a & ¬Δ[F10]a
6213    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6214  AOT_hence 𝒜[F10]b and ¬Δ[F10]b and 𝒜[F10]a and ¬Δ[F10]a
6215    using "&E" by blast+
6216  note props = props this
6217
6218  AOT_modally_strict {
6219    AOT_have y ¬[E!]y] by "cqt:2[lambda]"
6220  } note 1 = this
6221  moreover AOT_have 𝒜y ¬[E!]y]b & ¬Δy ¬[E!]y]b & 𝒜y ¬[E!]y]a & Δy ¬[E!]y]a
6222  proof (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6223    AOT_show 𝒜¬[E!]b
6224      using "Act-Basic:1" "∨E"(2) not_act_concrete_b by blast
6225  next AOT_show ¬Δ¬[E!]b
6226      using "≡dfE" "conventions:5" "Act-Basic:1" act_and_not_nec_not_delta b_prop "&E"(1) "∨E"(2) not_act_concrete_b by blast
6227  next AOT_show 𝒜¬[E!]a
6228      using "Act-Basic:1" "∨E"(2) not_act_concrete_a by blast
6229  next AOT_show Δ¬[E!]a
6230      using "KBasic2:1" "≡E"(2) nec_delta not_act_and_pos_delta not_act_concrete_a not_delta_concrete_a "reductio-aa:1" by blast
6231  qed
6232  ultimately AOT_obtain F11 where 𝒜[F11]b & ¬Δ[F11]b & 𝒜[F11]a & Δ[F11]a
6233    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6234  AOT_hence 𝒜[F11]b and ¬Δ[F11]b and 𝒜[F11]a and Δ[F11]a
6235    using "&E" by blast+
6236  note props = props this
6237
6238  AOT_have 𝒜[O!]b & Δ[O!]b & ¬𝒜[O!]a & ¬Δ[O!]a
6239    by (simp add: act_ord_b "&I" delta_ord_b not_act_ord_a not_delta_ord_a)
6240  then AOT_obtain F12 where 𝒜[F12]b & Δ[F12]b & ¬𝒜[F12]a & ¬Δ[F12]a
6241    using "oa-exist:1" "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6242  AOT_hence 𝒜[F12]b and Δ[F12]b and ¬𝒜[F12]a and ¬Δ[F12]a
6243    using "&E" by blast+
6244  note props = props this
6245
6246  let  = "«y [O!]y  q0]»"
6247  AOT_modally_strict {
6248    AOT_have [«»] by "cqt:2[lambda]"
6249  } note 1 = this
6250  moreover AOT_have 𝒜[«»]b & Δ[«»]b & ¬𝒜[«»]a & Δ[«»]a
6251  proof (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6252    AOT_show 𝒜([O!]b  q0)
6253      by (meson "Act-Basic:9" act_ord_b "∨I"(1) "≡E"(2))
6254  next AOT_show Δ([O!]b  q0)
6255      by (meson "KBasic:15" b_ord "∨I"(1) nec_delta "oa-facts:1" "vdash-properties:10")
6256  next AOT_show ¬𝒜([O!]a  q0)
6257      using "Act-Basic:9" "∨E"(2) "≡E"(4) not_act_ord_a not_act_q_zero "raa-cor:3" by blast
6258  next AOT_show Δ([O!]a  q0)
6259    proof (rule not_act_and_pos_delta)
6260      AOT_show ¬𝒜([O!]a  q0)
6261        using "Act-Basic:9" "∨E"(2) "≡E"(4) not_act_ord_a not_act_q_zero "raa-cor:3" by blast
6262    next AOT_show ([O!]a  q0)
6263        using "KBasic2:2" "&E"(1) "∨I"(2) "≡E"(2) q0_prop by blast
6264    qed
6265  qed
6266  ultimately AOT_obtain F13 where 𝒜[F13]b & Δ[F13]b & ¬𝒜[F13]a & Δ[F13]a
6267    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6268  AOT_hence 𝒜[F13]b and Δ[F13]b and ¬𝒜[F13]a and Δ[F13]a
6269    using "&E" by blast+
6270  note props = props this
6271
6272  let  = "«y [O!]y  ¬q0]»"
6273  AOT_modally_strict {
6274     AOT_have [«»] by "cqt:2[lambda]"
6275  } note 1 = this
6276  moreover AOT_have 𝒜[«»]b & Δ[«»]b & 𝒜[«»]a & ¬Δ[«»]a
6277  proof (safe intro!: "&I"; AOT_subst_using subst: "beta-C-meta"[THEN "→E", OF 1])
6278    AOT_show 𝒜([O!]b  ¬q0)
6279      by (meson "Act-Basic:9" act_not_q_zero "∨I"(2) "≡E"(2))
6280  next AOT_show Δ([O!]b  ¬q0)
6281      by (meson "KBasic:15" b_ord "∨I"(1) nec_delta "oa-facts:1" "vdash-properties:10")
6282  next AOT_show 𝒜([O!]a  ¬q0)
6283      by (meson "Act-Basic:9" act_not_q_zero "∨I"(2) "≡E"(2))
6284  next AOT_show ¬Δ([O!]a  ¬q0)
6285    proof(rule act_and_pos_not_not_delta)
6286      AOT_show 𝒜([O!]a  ¬q0)
6287        by (meson "Act-Basic:9" act_not_q_zero "∨I"(2) "≡E"(2))
6288    next
6289      AOT_have ¬[O!]a
6290        using "KBasic2:1" "≡E"(2) not_act_and_pos_delta not_act_ord_a not_delta_ord_a "raa-cor:6" by blast
6291      moreover AOT_have q0
6292        by (meson "&E"(1) q0_prop)
6293      ultimately AOT_have 2: (¬[O!]a & q0)
6294         by (metis "KBasic:16" "&I" "vdash-properties:10")
6295      AOT_show ¬([O!]a  ¬q0)
6296      proof (AOT_subst (reverse) ¬([O!]a  ¬q0) ¬[O!]a & q0)
6297        AOT_modally_strict {
6298          AOT_show ¬[O!]a & q0  ¬([O!]a  ¬q0)
6299            by (metis "&I" "&E"(1) "&E"(2) "∨I"(1) "∨I"(2)
6300                      "∨E"(3) "deduction-theorem" "≡I" "raa-cor:3")
6301        }
6302      next
6303        AOT_show (¬[O!]a & q0)
6304          using "2" by blast
6305      qed
6306    qed
6307  qed
6308  ultimately AOT_obtain F14 where 𝒜[F14]b & Δ[F14]b & 𝒜[F14]a & ¬Δ[F14]a
6309    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6310  AOT_hence 𝒜[F14]b and Δ[F14]b and 𝒜[F14]a and ¬Δ[F14]a
6311    using "&E" by blast+
6312  note props = props this
6313
6314  AOT_have [L]
6315    by (rule "=dfI"(2)[OF L_def]) "cqt:2[lambda]"+
6316  moreover AOT_have 𝒜[L]b & Δ[L]b & 𝒜[L]a & Δ[L]a
6317  proof (safe intro!: "&I")
6318    AOT_show 𝒜[L]b
6319      by (meson nec_L "nec-imp-act" "vdash-properties:10")
6320    next AOT_show Δ[L]b using nec_L nec_delta by blast
6321    next AOT_show 𝒜[L]a by (meson nec_L "nec-imp-act" "vdash-properties:10")
6322    next AOT_show Δ[L]a using nec_L nec_delta by blast
6323  qed
6324  ultimately AOT_obtain F15 where 𝒜[F15]b & Δ[F15]b & 𝒜[F15]a & Δ[F15]a
6325    using "∃I"(1)[rotated, THEN "∃E"[rotated]] by fastforce
6326  AOT_hence 𝒜[F15]b and Δ[F15]b and 𝒜[F15]a and Δ[F15]a
6327    using "&E" by blast+
6328  note props = props this
6329
6330  show ?thesis
6331    by (rule "∃I"(2)[where β=F0]; rule "∃I"(2)[where β=F1]; rule "∃I"(2)[where β=F2];
6332           rule "∃I"(2)[where β=F3]; rule "∃I"(2)[where β=F4]; rule "∃I"(2)[where β=F5];
6333           rule "∃I"(2)[where β=F6]; rule "∃I"(2)[where β=F7]; rule "∃I"(2)[where β=F8];
6334           rule "∃I"(2)[where β=F9]; rule "∃I"(2)[where β=F10]; rule "∃I"(2)[where β=F11];
6335           rule "∃I"(2)[where β=F12]; rule "∃I"(2)[where β=F13]; rule "∃I"(2)[where β=F14];
6336           rule "∃I"(2)[where β=F15]; safe intro!: "&I")
6337       (match conclusion in "[?v  [F]  [G]]" for F G  6338        match props in A: "[?v  ¬φ{F}]" for φ 6339        match (φ) in "λa . ?p" fail¦ "λa . a" fail¦ _ 6340        match props in B: "[?v  φ{G}]" 6341        fact "pos-not-equiv-ne:4"[where F=F and G=G and φ=φ, THEN "→E",
6342                                OF "oth-class-taut:4:h"[THEN "≡E"(2)],
6343                                OF "Disjunction Addition"(2)[THEN "→E"],
6344                                OF "&I", OF A, OF B]››››)+
6345qed
6346
6347AOT_theorem "o-objects-exist:1": x O!x
6348proof(rule RN)
6349  AOT_modally_strict {
6350    AOT_obtain a where (E!a & ¬𝒜[E!]a)
6351      using "∃E"[rotated, OF "qml:4"[axiom_inst, THEN "BF◇"[THEN "→E"]]] by blast
6352    AOT_hence 1: E!a by (metis "KBasic2:3" "&E"(1) "→E")
6353    AOT_have x [E!]x]a
6354    proof (rule "β←C"(1); "cqt:2[lambda]"?)
6355      AOT_show a using "cqt:2[const_var]"[axiom_inst] by blast
6356    next
6357      AOT_show E!a by (fact 1)
6358    qed
6359    AOT_hence O!a by (rule "=dfI"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
6360    AOT_thus x [O!]x by (rule "∃I")
6361  }
6362qed
6363
6364AOT_theorem "o-objects-exist:2": x A!x
6365proof (rule RN)
6366  AOT_modally_strict {
6367    AOT_obtain a where [A!]a
6368      using "A-objects"[axiom_inst] "∃E"[rotated] "&E" by blast
6369    AOT_thus x A!x using "∃I" by blast
6370  }
6371qed
6372
6373AOT_theorem "o-objects-exist:3": ¬x O!x
6374  by (rule RN) (metis (no_types, hide_lams) "∃E" "cqt-orig:1[const_var]" "≡E"(4) "modus-tollens:1" "o-objects-exist:2" "oa-contingent:2" "qml:2"[axiom_inst] "reductio-aa:2")
6375
6376AOT_theorem "o-objects-exist:4": ¬x A!x
6377  by (rule RN) (metis (mono_tags, hide_lams) "∃E" "cqt-orig:1[const_var]" "≡E"(1) "modus-tollens:1" "o-objects-exist:1" "oa-contingent:2" "qml:2"[axiom_inst] "→E")
6378
6379AOT_theorem "o-objects-exist:5": ¬x E!x
6380proof (rule RN; rule "raa-cor:2")
6381  AOT_modally_strict {
6382    AOT_assume x E!x
6383    moreover AOT_obtain a where abs: A!a
6384      using "o-objects-exist:2"[THEN "qml:2"[axiom_inst, THEN "→E"]] "∃E"[rotated] by blast
6385    ultimately AOT_have E!a using "∀E" by blast
6386    AOT_hence 1: E!a by (metis "T◇" "→E")
6387    AOT_have y E!y]a
6388    proof (rule "β←C"(1); "cqt:2[lambda]"?)
6389      AOT_show a using "cqt:2[const_var]"[axiom_inst].
6390    next
6391      AOT_show E!a by (fact 1)
6392    qed
6393    AOT_hence O!a
6394      by (rule "=dfI"(2)[OF AOT_ordinary, rotated]) "cqt:2[lambda]"
6395    AOT_hence ¬A!a by (metis "≡E"(1) "oa-contingent:2") 
6396    AOT_thus p & ¬p for p using abs by (metis "raa-cor:3")
6397  }
6398qed
6399
6400AOT_theorem partition: ¬x (O!x & A!x)
6401proof(rule "raa-cor:2")
6402  AOT_assume x (O!x & A!x)
6403  then AOT_obtain a where O!a & A!a using "∃E"[rotated] by blast
6404  AOT_thus p & ¬p for p by (metis "&E"(1) "Conjunction Simplification"(2) "≡E"(1) "modus-tollens:1" "oa-contingent:2" "raa-cor:3")
6405qed
6406
6407AOT_define eq_E :: ‹Π› ("'(=E')") "=E": (=E) =df xy O!x & O!y & F ([F]x  [F]y)]
6408
6409syntax "_AOT_eq_E_infix" :: ‹τ  τ  φ› (infixl "=E" 50)
6410translations
6411  "_AOT_eq_E_infix κ κ'" == "CONST AOT_exe (CONST eq_E) (CONST Pair κ κ')"
6412(* TODO: try to replace by a simple translations pattern *)
6413print_translation6414AOT_syntax_print_translations
6415[(const_syntax‹AOT_exe›, fn ctxt => fn [
6416  Const ("constAOT_PLM.eq_E", _),
6417  Const (const_syntax‹Pair›, _) $ lhs $ rhs
6418] => Const (syntax_const‹_AOT_eq_E_infix›, dummyT) $ lhs $ rhs)]
6419
6420text‹Note: Not explicitly mentioned as theorem in PLM.›
6421AOT_theorem "=E[denotes]": [(=E)]
6422  by (rule "=dfI"(2)[OF "=E"]) "cqt:2[lambda]"+
6423
6424AOT_theorem "=E-simple:1": x =E y  (O!x & O!y & F ([F]x  [F]y))
6425proof -
6426  (* TODO: rethink the product hacks *)
6427  AOT_have 0: «(AOT_term_of_var x,AOT_term_of_var y)»
6428    by (simp add: "&I" "cqt:2[const_var]" prod_denotesI "vdash-properties:1[2]")
6429  AOT_have 1: xy [O!]x & [O!]y & F ([F]x  [F]y)] by "cqt:2[lambda]"
6430  show ?thesis apply (rule "=dfI"(2)[OF "=E"]; "cqt:2[lambda]"?)
6431    using "beta-C-meta"[THEN "→E", OF 1, unvarify ν1νn, of "(AOT_term_of_var x,AOT_term_of_var y)", OF 0]
6432    by fast
6433qed
6434
6435AOT_theorem "=E-simple:2": x =E y  x = y
6436proof (rule "→I")
6437  AOT_assume x =E y
6438  AOT_hence O!x & O!y & F ([F]x  [F]y) using "=E-simple:1"[THEN "≡E"(1)] by blast
6439  AOT_thus x = y
6440    using "≡dfI"[OF "identity:1"] "∨I" by blast
6441qed
6442
6443AOT_theorem "id-nec3:1": x =E y  (x =E y)
6444proof (rule "≡I"; rule "→I")
6445  AOT_assume x =E y
6446  AOT_hence O!x & O!y & F ([F]x  [F]y)
6447    using "=E-simple:1" "≡E" by blast
6448  AOT_hence O!x & O!y & F ([F]x  [F]y)
6449    by (metis "S5Basic:6" "&I" "&E"(1) "&E"(2) "≡E"(4) "oa-facts:1" "raa-cor:3" "vdash-properties:10")
6450  AOT_hence (O!x & O!y & F ([F]x  [F]y))
6451    by (metis "&E"(1) "&E"(2) "≡E"(2) "KBasic:3" "&I")
6452  AOT_thus (x =E y)
6453    using "=E-simple:1"
6454    by (AOT_subst x =E y O!x & O!y & F ([F]x  [F]y)) auto
6455next
6456  AOT_assume (x =E y)
6457  AOT_thus x =E y using "qml:2"[axiom_inst, THEN "→E"] by blast
6458qed
6459
6460AOT_theorem "id-nec3:2": (x =E y)  x =E y
6461  by (meson "RE◇" "S5Basic:2" "id-nec3:1" "≡E"(1) "≡E"(5) "Commutativity of ≡")
6462
6463AOT_theorem "id-nec3:3": (x =E y)  (x =E y)
6464  by (meson "id-nec3:1" "id-nec3:2" "≡E"(5))
6465
6466syntax "_AOT_non_eq_E" :: ‹Π› ("'(≠E')")
6467translations
6468  (Π) "(≠E)" == (Π) "(=E)-"
6469syntax "_AOT_non_eq_E_infix" :: ‹τ  τ  φ› (infixl "E" 50)
6470translations
6471 "_AOT_non_eq_E_infix κ κ'" == "CONST AOT_exe (CONST relation_negation (CONST eq_E)) (CONST Pair κ κ')"
6472(* TODO: try replacing be a simple translations pattern *)
6473print_translation6474AOT_syntax_print_translations
6475[(const_syntax‹AOT_exe›, fn ctxt => fn [
6476  Const (const_syntax‹relation_negation›, _) $ Const ("constAOT_PLM.eq_E", _),
6477  Const (const_syntax‹Pair›, _) $ lhs $ rhs
6478] => Const (syntax_const‹_AOT_non_eq_E_infix›, dummyT) $ lhs $ rhs)]
6479AOT_theorem "thm-neg=E": x E y  ¬(x =E y)
6480proof -
6481  (* TODO: rethink the product hacks *)
6482  AOT_have 0: «(AOT_term_of_var x,AOT_term_of_var y)»
6483    by (simp add: "&I" "cqt:2[const_var]" prod_denotesI "vdash-properties:1[2]")
6484  AOT_have θ: x1...x2 ¬(=E)x1...x2] by "cqt:2[lambda]" (* TODO_PLM: convoluted proof in PLM; TODO: product hack *)
6485  AOT_have x E y  x1...x2 ¬(=E)x1...x2]xy
6486    by (rule "=dfI"(1)[OF "df-relation-negation", OF θ])
6487       (meson "oth-class-taut:3:a")
6488  also AOT_have   ¬(=E)xy
6489    apply (rule "beta-C-meta"[THEN "→E", unvarify ν1νn])
6490     apply "cqt:2[lambda]"
6491    by (fact 0)
6492  finally show ?thesis.
6493qed
6494
6495AOT_theorem "id-nec4:1": x E y  (x E y)
6496proof -
6497  AOT_have x E y  ¬(x =E y) using "thm-neg=E".
6498  also AOT_have   ¬(x =E y)
6499    by (meson "id-nec3:2" "≡E"(1) "Commutativity of ≡" "oth-class-taut:4:b")
6500  also AOT_have   ¬(x =E y)
6501    by (meson "KBasic2:1" "≡E"(2) "Commutativity of ≡")
6502  also AOT_have   (x E y)
6503    by (AOT_subst (reverse) ¬(x =E y) x E y)
6504       (auto simp: "thm-neg=E" "oth-class-taut:3:a")
6505  finally show ?thesis.
6506qed
6507
6508AOT_theorem "id-nec4:2": (x E y)  (x E y)
6509  by (meson "RE◇" "S5Basic:2" "id-nec4:1" "≡E"(2) "≡E"(5) "Commutativity of ≡")
6510
6511AOT_theorem "id-nec4:3": (x E y)  (x E y)
6512  by (meson "id-nec4:1" "id-nec4:2" "≡E"(5))
6513
6514AOT_theorem "id-act2:1": x =E y  𝒜x =E y
6515  by (meson "Act-Basic:5" "Act-Sub:2" "RA[2]" "id-nec3:2" "≡E"(1) "≡E"(6))
6516AOT_theorem "id-act2:2": x E y  𝒜x E y
6517  by (meson "Act-Basic:5" "Act-Sub:2" "RA[2]" "id-nec4:2" "≡E"(1) "≡E"(6))
6518
6519AOT_theorem "ord=Eequiv:1": O!x  x =E x
6520proof (rule "→I")
6521  AOT_assume 1: O!x
6522  AOT_show x =E x
6523    apply (rule "=dfI"(2)[OF "=E"]) apply "cqt:2[lambda]"
6524    apply (rule "β←C"(1))
6525      apply "cqt:2[lambda]"
6526     apply (simp add: "&I" "cqt:2[const_var]" prod_denotesI "vdash-properties:1[2]")
6527    by (simp add: "1" RN "&I" "oth-class-taut:3:a" "universal-cor")
6528qed
6529
6530AOT_theorem "ord=Eequiv:2": x =E y  y =E x
6531proof(rule CP)
6532  AOT_assume 1: x =E y
6533  AOT_hence 2: x = y by (metis "=E-simple:2" "vdash-properties:10") 
6534  AOT_have O!x using 1 by (meson "&E"(1) "=E-simple:1" "≡E"(1))
6535  AOT_hence x =E x using "ord=Eequiv:1" "→E" by blast
6536  AOT_thus y =E x using "rule=E"[rotated, OF 2] by fast
6537qed
6538
6539AOT_theorem "ord=Eequiv:3": (x =E y & y =E z)  x =E z
6540proof (rule CP)
6541  AOT_assume 1: x =E y & y =E z
6542  AOT_hence x = y & y = z
6543    by (metis "&I" "&E"(1) "&E"(2) "=E-simple:2" "vdash-properties:6")
6544  AOT_hence x = z by (metis "id-eq:3" "vdash-properties:6")
6545  moreover AOT_have x =E x
6546    using 1[THEN "&E"(1)] "&E"(1) "=E-simple:1" "≡E"(1) "ord=Eequiv:1" "→E" by blast
6547  ultimately AOT_show x =E z
6548    using "rule=E" by fast
6549qed
6550
6551AOT_theorem "ord-=E=:1": (O!x  O!y)  (x = y  x =E y)
6552proof(rule CP)
6553  AOT_assume O!x  O!y
6554  moreover {
6555    AOT_assume O!x
6556    AOT_hence O!x by (metis "oa-facts:1" "vdash-properties:10")
6557    moreover {
6558      AOT_modally_strict {
6559        AOT_have O!x  (x = y  x =E y)
6560        proof (rule "→I"; rule "≡I"; rule "→I")
6561          AOT_assume O!x
6562          AOT_hence x =E x by (metis "ord=Eequiv:1" "→E")
6563          moreover AOT_assume x = y
6564          ultimately AOT_show x =E y using "rule=E" by fast
6565        next
6566          AOT_assume x =E y
6567          AOT_thus x = y by (metis "=E-simple:2" "→E")
6568        qed
6569      }
6570      AOT_hence O!x  (x = y  x =E y) by (metis "RM:1")
6571    }
6572    ultimately AOT_have (x = y  x =E y) using "→E" by blast
6573  }
6574  moreover {
6575    AOT_assume O!y
6576    AOT_hence O!y by (metis "oa-facts:1" "vdash-properties:10")
6577    moreover {
6578      AOT_modally_strict {
6579        AOT_have O!y  (x = y  x =E y)
6580        proof (rule "→I"; rule "≡I"; rule "→I")
6581          AOT_assume O!y
6582          AOT_hence y =E y by (metis "ord=Eequiv:1" "→E")
6583          moreover AOT_assume x = y
6584          ultimately AOT_show x =E y using "rule=E" id_sym by fast
6585        next
6586          AOT_assume x =E y
6587          AOT_thus x = y by (metis "=E-simple:2" "→E")
6588        qed
6589      }
6590      AOT_hence O!y  (x = y  x =E y) by (metis "RM:1")
6591    }
6592    ultimately AOT_have (x = y  x =E y) using "→E" by blast
6593  }
6594  ultimately AOT_show (x = y  x =E y) by (metis "∨E"(3) "raa-cor:1")
6595qed
6596
6597AOT_theorem "ord-=E=:2": O!y  x x = y]
6598proof (rule "→I"; rule "safe-ext"[axiom_inst, THEN "→E"]; rule "&I")
6599  AOT_show x x =E y] by "cqt:2[lambda]"
6600next
6601  AOT_assume O!y
6602  AOT_hence 1: (x = y  x =E y) for x using "ord-=E=:1" "→E" "∨I" by blast
6603  AOT_have (x =E y  x = y) for x
6604    by (AOT_subst x =E y  x = y x = y  x =E y)
6605       (auto simp add: "Commutativity of ≡" 1)
6606  AOT_hence x (x =E y  x = y) by (rule GEN)
6607  AOT_thus x (x =E y  x = y) by (rule BF[THEN "→E"])
6608qed
6609
6610
6611AOT_theorem "ord-=E=:3": xy O!x & O!y & x = y]
6612proof (rule "safe-ext[2]"[axiom_inst, THEN "→E"]; rule "&I")
6613  AOT_show xy O!x & O!y & x =E y] by "cqt:2[lambda]"
6614next
6615  AOT_show xy ([O!]x & [O!]y & x =E y  [O!]x & [O!]y & x = y)
6616  proof (rule RN; rule GEN; rule GEN; rule "≡I"; rule "→I")
6617    AOT_modally_strict {
6618      AOT_show [O!]x & [O!]y & x = y if [O!]x & [O!]y & x =E y for x y
6619        by (metis "&I" "&E"(1) "Conjunction Simplification"(2) "=E-simple:2"
6620                  "modus-tollens:1" "raa-cor:1" that)
6621    }
6622  next
6623    AOT_modally_strict {
6624      AOT_show [O!]x & [O!]y & x =E y if [O!]x & [O!]y & x = y for x y
6625        apply(safe intro!: "&I")
6626          apply (metis that[THEN "&E"(1), THEN "&E"(1)])
6627         apply (metis that[THEN "&E"(1), THEN "&E"(2)])
6628        using "rule=E"[rotated, OF that[THEN "&E"(2)]]
6629              "ord=Eequiv:1"[THEN "→E", OF that[THEN "&E"(1), THEN "&E"(1)]] by fast
6630    }
6631  qed
6632qed
6633
6634AOT_theorem "ind-nec": F ([F]x  [F]y)  F ([F]x  [F]y)
6635proof(rule "→I")
6636  AOT_assume F ([F]x  [F]y)
6637  moreover AOT_have x F ([F]x  [F]y)] by "cqt:2[lambda]"
6638  ultimately AOT_have x F ([F]x  [F]y)]x  x F ([F]x  [F]y)]y
6639    using "∀E" by blast
6640  moreover AOT_have x F ([F]x  [F]y)]y
6641    apply (rule "β←C"(1))
6642      apply "cqt:2[lambda]"
6643     apply (fact "cqt:2[const_var]"[axiom_inst])
6644    by (simp add: RN GEN "oth-class-taut:3:a")
6645  ultimately AOT_have x F ([F]x  [F]y)]x using "≡E" by blast
6646  AOT_thus F ([F]x  [F]y)
6647    using "β→C"(1) by blast
6648qed
6649
6650AOT_theorem "ord=E:1": (O!x & O!y)  (F ([F]x  [F]y)  x =E y)
6651proof (rule "→I"; rule "→I")
6652  AOT_assume F ([F]x  [F]y)
6653  AOT_hence F ([F]x  [F]y)
6654    using "ind-nec"[THEN "→E"] by blast
6655  moreover AOT_assume O!x & O!y
6656  ultimately AOT_have O!x & O!y & F ([F]x  [F]y)
6657    using "&I" by blast
6658  AOT_thus x =E y using "=E-simple:1"[THEN "≡E"(2)] by blast
6659qed
6660
6661AOT_theorem "ord=E:2": (O!x & O!y)  (F ([F]x  [F]y)  x = y)
6662proof (rule "→I"; rule "→I")
6663  AOT_assume O!x & O!y
6664  moreover AOT_assume F ([F]x  [F]y)
6665  ultimately AOT_have x =E y
6666    using "ord=E:1" "→E" by blast
6667  AOT_thus x = y using "=E-simple:2"[THEN "→E"] by blast
6668qed
6669
6670AOT_theorem "ord=E2:1": (O!x & O!y)  (x  y  z z =E x]  z z =E y])
6671proof (rule "→I"; rule "≡I"; rule "→I"; rule "≡dfI"[OF "=-infix"]; rule "raa-cor:2")
6672  AOT_assume 0: O!x & O!y
6673  AOT_assume x  y
6674  AOT_hence 1: ¬(x = y) using "≡dfE"[OF "=-infix"] by blast
6675  AOT_assume z z =E x] = z z =E y]
6676  moreover AOT_have z z =E x]x
6677    apply (rule "β←C"(1))
6678      apply "cqt:2[lambda]"
6679     apply (fact "cqt:2[const_var]"[axiom_inst])
6680    using "ord=Eequiv:1"[THEN "→E", OF 0[THEN "&E"(1)]].
6681  ultimately AOT_have z z =E y]x using "rule=E" by fast
6682  AOT_hence x =E y using "β→C"(1) by blast
6683  AOT_hence x = y by (metis "=E-simple:2" "vdash-properties:6")
6684  AOT_thus x = y & ¬(x = y) using 1 "&I" by blast
6685next
6686  AOT_assume z z =E x]  z z =E y]
6687  AOT_hence 0: ¬(z z =E x] = z z =E y]) using "≡dfE"[OF "=-infix"] by blast
6688  AOT_have z z =E x] by "cqt:2[lambda]"
6689  AOT_hence z z =E x] = z z =E x]
6690    by (metis "rule=I:1")
6691  moreover AOT_assume x = y
6692  ultimately AOT_have z z =E x] = z z =E y]
6693    using "rule=E" by fast
6694  AOT_thus z z =E x] = z z =E y] & ¬(z z =E x] = z z =E y])
6695    using 0 "&I" by blast
6696qed
6697
6698AOT_theorem "ord=E2:2": (O!x & O!y)  (x  y  z z = x]  z z = y])
6699proof (rule "→I"; rule "≡I"; rule "→I"; rule "≡dfI"[OF "=-infix"]; rule "raa-cor:2")
6700  AOT_assume 0: O!x & O!y
6701  AOT_assume x  y
6702  AOT_hence 1: ¬(x = y) using "≡dfE"[OF "=-infix"] by blast
6703  AOT_assume z z = x] = z z = y]
6704  moreover AOT_have z z = x]x
6705    apply (rule "β←C"(1))
6706    apply (fact "ord-=E=:2"[THEN "→E", OF 0[THEN "&E"(1)]])
6707     apply (fact "cqt:2[const_var]"[axiom_inst])
6708    by (simp add: "id-eq:1")
6709  ultimately AOT_have z z = y]x using "rule=E" by fast
6710  AOT_hence x = y using "β→C"(1) by blast
6711  AOT_thus x = y & ¬(x = y) using 1 "&I" by blast
6712next
6713  AOT_assume 0: O!x & O!y
6714  AOT_assume z z = x]  z z = y]
6715  AOT_hence 1: ¬(z z = x] = z z = y]) using "≡dfE"[OF "=-infix"] by blast
6716  AOT_have z z = x] by (fact "ord-=E=:2"[THEN "→E", OF 0[THEN "&E"(1)]])
6717  AOT_hence z z = x] = z z = x]
6718    by (metis "rule=I:1")
6719  moreover AOT_assume x = y
6720  ultimately AOT_have z z = x] = z z = y]
6721    using "rule=E" by fast
6722  AOT_thus z z = x] = z z = y] & ¬(z z = x] = z z = y])
6723    using 1 "&I" by blast
6724qed
6725
6726AOT_theorem ordnecfail: O!x  ¬F x[F]
6727  by (meson "RM:1" "deduction-theorem" nocoder "oa-facts:1" "vdash-properties:10" "vdash-properties:1[2]")
6728
6729AOT_theorem "ab-obey:1": (A!x & A!y)  (F (x[F]  y[F])  x = y)
6730proof (rule "→I"; rule "→I")
6731  AOT_assume 1: A!x & A!y
6732  AOT_assume F (x[F]  y[F])
6733  AOT_hence x[F]  y[F] for F using "∀E" by blast
6734  AOT_hence (x[F]  y[F]) for F by (metis "en-eq:6[1]" "≡E"(1))
6735  AOT_hence F (x[F]  y[F]) by (rule GEN)
6736  AOT_hence F (x[F]  y[F]) by (rule BF[THEN "→E"])
6737  AOT_thus x = y
6738    using "≡dfI"[OF "identity:1", OF "∨I"(2)] 1 "&I" by blast
6739qed
6740
6741AOT_theorem "ab-obey:2": (F (x[F] & ¬y[F])  F (y[F] & ¬x[F]))  x  y
6742proof (rule "→I"; rule "≡dfI"[OF "=-infix"]; rule "raa-cor:2")
6743  AOT_assume 1: x = y
6744  AOT_assume F (x[F] & ¬y[F])  F (y[F] & ¬x[F])
6745  moreover {
6746    AOT_assume F (x[F] & ¬y[F])
6747    then AOT_obtain F where x[F] & ¬y[F] using "∃E"[rotated] by blast
6748    moreover AOT_have y[F] using calculation[THEN "&E"(1)] 1 "rule=E" by fast
6749    ultimately AOT_have p & ¬p for p by (metis "Conjunction Simplification"(2) "modus-tollens:2" "raa-cor:3")
6750  }
6751  moreover {
6752    AOT_assume F (y[F] & ¬x[F])
6753    then AOT_obtain F where y[F] & ¬x[F] using "∃E"[rotated] by blast
6754    moreover AOT_have ¬y[F] using calculation[THEN "&E"(2)] 1 "rule=E" by fast
6755    ultimately AOT_have p & ¬p for p by (metis "Conjunction Simplification"(1) "modus-tollens:1" "raa-cor:3")
6756  }
6757  ultimately AOT_show p & ¬p for p by (metis "∨E"(3) "raa-cor:1")
6758qed
6759
6760AOT_theorem "encoders-are-abstract": F x[F]  A!x
6761  by (meson "deduction-theorem" "≡E"(2) "modus-tollens:2" nocoder
6762            "oa-contingent:3" "vdash-properties:1[2]")
6763
6764AOT_theorem "denote=:1": Hx x[H]
6765  by (rule GEN; rule "existence:2[1]"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6766
6767AOT_theorem "denote=:2": Gx1...∃xn x1...xn[H]
6768  by (rule GEN; rule "existence:2"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6769
6770AOT_theorem "denote=:2[2]": Gx1x2 x1x2[H]
6771  by (rule GEN; rule "existence:2[2]"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6772
6773AOT_theorem "denote=:2[3]": Gx1x2x3 x1x2x3[H]
6774  by (rule GEN; rule "existence:2[3]"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6775
6776AOT_theorem "denote=:2[4]": Gx1x2x3x4 x1x2x3x4[H]
6777  by (rule GEN; rule "existence:2[4]"[THEN "≡dfE"]; fact "cqt:2[const_var]"[axiom_inst])
6778
6779AOT_theorem "denote=:3": x x[Π]  H (H = Π)
6780  using "existence:2[1]" "free-thms:1" "≡E"(2) "≡E"(5) "Commutativity of ≡" "≡Df" by blast
6781
6782AOT_theorem "denote=:4": (x1...∃xn x1...xn[Π])  H (H = Π)
6783  using "existence:2" "free-thms:1" "≡E"(6) "≡Df" by blast
6784
6785AOT_theorem "denote=:4[2]": (x1x2 x1x2[Π])  H (H = Π)
6786  using "existence:2[2]" "free-thms:1" "≡E"(6) "≡Df" by blast
6787
6788AOT_theorem "denote=:4[3]": (x1x2x3 x1x2x3[Π])  H (H = Π)
6789  using "existence:2[3]" "free-thms:1" "≡E"(6) "≡Df" by blast
6790
6791AOT_theorem "denote=:4[4]": (x1x2x3x4 x1x2x3x4[Π])  H (H = Π)
6792  using "existence:2[4]" "free-thms:1" "≡E"(6) "≡Df" by blast
6793
6794AOT_theorem "A-objects!": ∃!x (A!x & F (x[F]  φ{F}))
6795proof (rule "uniqueness:1"[THEN "≡dfI"])
6796  AOT_obtain a where a_prop: A!a & F (a[F]  φ{F})
6797    using "A-objects"[axiom_inst] "∃E"[rotated] by blast
6798  AOT_have (A!β & F (β[F]  φ{F}))  β = a for β
6799  proof (rule "→I")
6800    AOT_assume β_prop: [A!]β & F (β[F]  φ{F})
6801    AOT_hence β[F]  φ{F} for F using "∀E" "&E" by blast
6802    AOT_hence β[F]  a[F] for F
6803      using a_prop[THEN "&E"(2)] "∀E" "≡E"(2) "≡E"(5) "Commutativity of ≡" by fast
6804    AOT_hence F (β[F]  a[F]) by (rule GEN)
6805    AOT_thus β = a
6806      using "ab-obey:1"[THEN "→E", OF "&I"[OF β_prop[THEN "&E"(1)], OF a_prop[THEN "&E"(1)]], THEN "→E"] by blast
6807  qed
6808  AOT_hence β ((A!β & F (β[F]  φ{F}))  β = a) by (rule GEN)
6809  AOT_thus α ([A!]α & F (α[F]  φ{F}) & β ([A!]β & F (β[F]  φ{F})  β = α))
6810    using "∃I" using a_prop "&I" by fast
6811qed
6812
6813AOT_theorem "obj-oth:1": ∃!x (A!x & F (x[F]  [F]y))
6814  using "A-objects!" by fast
6815
6816AOT_theorem "obj-oth:2": ∃!x (A!x & F (x[F]  [F]y & [F]z))
6817  using "A-objects!" by fast
6818
6819AOT_theorem "obj-oth:3": ∃!x (A!x & F (x[F]  [F]y  [F]z))
6820  using "A-objects!" by fast
6821
6822AOT_theorem "obj-oth:4": ∃!x (A!x & F (x[F]  [F]y))
6823  using "A-objects!" by fast
6824
6825AOT_theorem "obj-oth:5": ∃!x (A!x & F (x[F]  F = G))
6826  using "A-objects!" by fast
6827
6828AOT_theorem "obj-oth:6": ∃!x (A!x & F (x[F]  y([G]y  [F]y)))
6829  using "A-objects!" by fast
6830
6831AOT_theorem "A-descriptions": ιx (A!x & F (x[F]  φ{F}))
6832  by (rule "A-Exists:2"[THEN "≡E"(2)]; rule "RA[2]"; rule "A-objects!")
6833
6834AOT_act_theorem "thm-can-terms2": y = ιx(A!x & F (x[F]  φ{F}))  (A!y & F (y[F]  φ{F}))
6835  using "y-in:2" by blast
6836
6837AOT_theorem "can-ab2": y = ιx(A!x & F (x[F]  φ{F}))   A!y
6838proof(rule "→I")
6839  AOT_assume y = ιx(A!x & F (x[F]  φ{F}))
6840  AOT_hence 𝒜(A!y & F (y[F]  φ{F}))
6841    using "actual-desc:2"[THEN "→E"] by blast
6842  AOT_hence 𝒜A!y by (metis "Act-Basic:2" "&E"(1) "≡E"(1))
6843  AOT_thus A!y by (metis "≡E"(2) "oa-facts:8")
6844qed
6845
6846AOT_act_theorem "desc-encode:1": ιx(A!x & F (x[F]  φ{F}))[F]  φ{F}
6847proof -
6848  AOT_have ιx(A!x & F (x[F]  φ{F}))
6849    by (simp add: "A-descriptions")
6850  AOT_hence A!ιx(A!x & F (x[F]  φ{F})) & F (ιx(A!x & F (x[F]  φ{F}))[F]  φ{F})
6851    using "y-in:3"[THEN "→E"] by blast
6852  AOT_thus ιx(A!x & F (x[F]  φ{F}))[F]  φ{F}
6853    using "&E" "∀E" by blast
6854qed
6855
6856AOT_act_theorem "desc-encode:2": ιx(A!x & F (x[F]  φ{F}))[G]  φ{G}
6857  using "desc-encode:1".
6858
6859AOT_theorem "desc-nec-encode:1": ιx (A!x & F (x[F]  φ{F}))[F]  𝒜φ{F}
6860proof -
6861  AOT_have 0: ιx(A!x & F (x[F]  φ{F}))
6862    by (simp add: "A-descriptions")
6863  AOT_hence 𝒜(A!ιx(A!x & F (x[F]  φ{F})) & F (ιx(A!x & F (x[F]  φ{F}))[F]  φ{F}))
6864    using "actual-desc:4"[THEN "→E"] by blast
6865  AOT_hence 𝒜F (ιx(A!x & F (x[F]  φ{F}))[F]  φ{F})
6866    using "Act-Basic:2" "&E"(2) "≡E"(1) by blast
6867  AOT_hence F 𝒜(ιx(A!x & F (x[F]  φ{F}))[F]  φ{F})
6868    using "≡E"(1) "logic-actual-nec:3" "vdash-properties:1[2]" by blast
6869  AOT_hence 𝒜(ιx(A!x & F (x[F]  φ{F}))[F]  φ{F})
6870    using "∀E" by blast
6871  AOT_hence 𝒜ιx(A!x & F (x[F]  φ{F}))[F]  𝒜φ{F}
6872    using "Act-Basic:5" "≡E"(1) by blast
6873  AOT_thus ιx(A!x & F (x[F]  φ{F}))[F]  𝒜φ{F}
6874    using "en-eq:10[1]"[unvarify x1, OF 0] "≡E"(6) by blast
6875qed
6876
6877AOT_theorem "desc-nec-encode:2": ιx (A!x & F (x[F]  φ{F}))[G]  𝒜φ{G}
6878  using "desc-nec-encode:1".
6879
6880AOT_theorem "Box-desc-encode:1": φ{G}  ιx(A!x & F (x[F]  φ{G}))[G]
6881  by (rule "→I"; rule "desc-nec-encode:2"[THEN "≡E"(2)])
6882     (meson "nec-imp-act" "vdash-properties:10")
6883
6884AOT_theorem "Box-desc-encode:2": φ{G}  (ιx(A!x & F (x[F]  φ{G}))[G]  φ{G})
6885proof(rule CP)
6886  AOT_assume φ{G}
6887  AOT_hence φ{G} by (metis "S5Basic:6" "≡E"(1))
6888  moreover AOT_have φ{G}  (ιx(A!x & F (x[F]  φ{G}))[G]  φ{G})
6889  proof (rule RM; rule "→I")
6890    AOT_modally_strict {
6891      AOT_assume 1: φ{G}
6892      AOT_hence ιx(A!x & F (x[F]  φ{G}))[G] using "Box-desc-encode:1" "→E" by blast
6893      moreover AOT_have φ{G} using 1 by (meson "qml:2" "vdash-properties:10" "vdash-properties:1[2]")
6894      ultimately AOT_show ιx(A!x & F (x[F]  φ{G}))[G]  φ{G}
6895        using "deduction-theorem" "≡I" by simp
6896    }
6897  qed
6898  ultimately AOT_show (ιx(A!x & F (x[F]  φ{G}))[G]  φ{G}) using "→E" by blast
6899qed
6900
6901definition rigid_condition where rigid_condition φ  v . [v  α (φ{α}  φ{α})]
6902syntax rigid_condition :: ‹id_position  AOT_prop› ("RIGID'_CONDITION'(_')")
6903
6904AOT_theorem "strict-can:1[E]": assumes RIGID_CONDITION(φ)
6905  shows α (φ{α}  φ{α})
6906  using assms[unfolded rigid_condition_def] by auto
6907
6908AOT_theorem "strict-can:1[I]":
6909  assumes  α (φ{α}  φ{α})
6910  shows RIGID_CONDITION(φ)
6911  using assms rigid_condition_def by auto
6912
6913AOT_theorem "box-phi-a:1": assumes RIGID_CONDITION(φ)
6914  shows (A!x  & F (x[F]  φ{F}))  (A!x & F (x[F]  φ{F}))
6915proof (rule "→I")
6916  AOT_assume a: A!x & F (x[F]  φ{F})
6917  AOT_hence b: A!x by (metis "Conjunction Simplification"(1) "oa-facts:2" "vdash-properties:10")
6918  AOT_have x[F]  φ{F} for F using a[THEN "&E"(2)] "∀E" by blast
6919  moreover AOT_have (x[F]  x[F]) for F by (meson "pre-en-eq:1[1]" RN)
6920  moreover AOT_have (φ{F}  φ{F}) for F using RN "strict-can:1[E]"[OF assms] "∀E" by blast
6921  ultimately AOT_have (x[F]  φ{F}) for F
6922    using "sc-eq-box-box:5" "qml:2"[axiom_inst, THEN "→E"] "→E" "&I" by metis
6923  AOT_hence F (x[F]  φ{F}) by (rule GEN)
6924  AOT_hence F (x[F]  φ{F}) by (rule BF[THEN "→E"])
6925  AOT_thus ([A!]x & F (x[F]  φ{F}))
6926    using b "KBasic:3" "≡S"(1) "≡E"(2) by blast
6927qed
6928
6929AOT_theorem "box-phi-a:2": assumes RIGID_CONDITION(φ)
6930  shows y = ιx(A!x & F (x[F]  φ{F}))  (A!y & F (y[F]  φ{F}))
6931proof(rule "→I")
6932  AOT_assume y = ιx(A!x & F (x[F]  φ{F}))
6933  AOT_hence 𝒜(A!y & F (y[F]  φ{F})) using "actual-desc:2"[THEN "→E"] by fast
6934  AOT_hence abs: 𝒜A!y and 𝒜F (y[F]  φ{F})
6935    using "Act-Basic:2" "&E" "≡E"(1) by blast+
6936  AOT_hence F 𝒜(y[F]  φ{F}) by (metis "≡E"(1) "logic-actual-nec:3" "vdash-properties:1[2]")
6937  AOT_hence 𝒜(y[F]  φ{F}) for F using "∀E" by blast
6938  AOT_hence 𝒜y[F]  𝒜φ{F} for F by (metis "Act-Basic:5" "≡E"(1)) 
6939  AOT_hence y[F]  φ{F} for F
6940    using "sc-eq-fur:2"[THEN "→E", OF "strict-can:1[E]"[OF assms, THEN "∀E"(2)[where β=F], THEN RN]]
6941    by (metis "en-eq:10[1]" "≡E"(6))
6942  AOT_hence F (y[F]  φ{F}) by (rule GEN)
6943  AOT_thus [A!]y & F (y[F]  φ{F}) using abs "&I" "≡E"(2) "oa-facts:8" by blast
6944qed
6945
6946AOT_theorem "box-phi-a:3": assumes RIGID_CONDITION(φ)
6947  shows ιx(A!x & F (x[F]  φ{F}))[F]  φ{F}
6948  using "desc-nec-encode:2"
6949    "sc-eq-fur:2"[THEN "→E", OF "strict-can:1[E]"[OF assms, THEN "∀E"(2)[where β=F], THEN RN]]
6950    "≡E"(5) by blast
6951
6952AOT_define Null :: ‹τ  φ› ("Null'(_')") 
6953  "df-null-uni:1": Null(x) df A!x & ¬F x[F]
6954
6955AOT_define Universal :: ‹τ  φ› ("Universal'(_')")
6956  "df-null-uni:2": Universal(x) df A!x & F x[F]
6957
6958AOT_theorem "null-uni-uniq:1": ∃!x Null(x)
6959proof (rule "uniqueness:1"[THEN "≡dfI"])
6960  AOT_obtain a where a_prop: A!a & F (a[F]  ¬(F = F))
6961    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
6962  AOT_have a_null: ¬a[F] for F
6963  proof (rule "raa-cor:2")
6964    AOT_assume a[F]
6965    AOT_hence ¬(F = F) using a_prop[THEN "&E"(2)] "∀E" "≡E" by blast
6966    AOT_hence F = F & ¬(F = F) by (metis "id-eq:1" "raa-cor:3")
6967    AOT_thus p & ¬p for p  by (metis "raa-cor:1")
6968  qed
6969  AOT_have Null(a) & β (Null(β)  β = a)
6970  proof (rule "&I")
6971    AOT_have ¬F a[F] using a_null by (metis "instantiation" "reductio-aa:1")
6972    AOT_thus Null(a)
6973      using "df-null-uni:1"[THEN "≡dfI"] a_prop[THEN "&E"(1)] "&I" by metis
6974  next
6975    AOT_show β (Null(β)  β = a)
6976    proof (rule GEN; rule "→I")
6977      fix β
6978      AOT_assume a: Null(β)
6979      AOT_hence ¬F β[F]
6980        using "df-null-uni:1"[THEN "≡dfE"] "&E" by blast
6981      AOT_hence β_null: ¬β[F] for F by (metis "existential:2[const_var]" "reductio-aa:1")
6982      AOT_have F (β[F]  a[F])
6983        apply (rule GEN; rule "≡I"; rule CP)
6984        using "raa-cor:3" β_null a_null by blast+
6985      moreover AOT_have A!β using a "df-null-uni:1"[THEN "≡dfE"] "&E" by blast
6986      ultimately AOT_show β = a
6987        using a_prop[THEN "&E"(1)] "ab-obey:1"[THEN "→E", THEN "→E"] "&I" by blast
6988    qed
6989  qed
6990  AOT_thus α (Null(α) & β (Null(β)  β = α)) using "∃I"(2) by fast
6991qed
6992
6993AOT_theorem "null-uni-uniq:2": ∃!x Universal(x)
6994proof (rule "uniqueness:1"[THEN "≡dfI"])
6995  AOT_obtain a where a_prop: A!a & F (a[F]  F = F)
6996    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
6997  AOT_hence aF: a[F] for F using "&E" "∀E" "≡E" "id-eq:1" by fast
6998  AOT_hence Universal(a)
6999    using "df-null-uni:2"[THEN "≡dfI"] "&I" a_prop[THEN "&E"(1)] GEN by blast
7000  moreover AOT_have β (Universal(β)  β = a)
7001  proof (rule GEN; rule "→I")
7002    fix β
7003    AOT_assume Universal(β)
7004    AOT_hence abs_β: A!β and β[F] for F using "df-null-uni:2"[THEN "≡dfE"] "&E" "∀E" by blast+
7005    AOT_hence β[F]  a[F] for F using aF by (metis "deduction-theorem" "≡I")
7006    AOT_hence F (β[F]  a[F]) by (rule GEN)
7007    AOT_thus β = a
7008      using a_prop[THEN "&E"(1)] "ab-obey:1"[THEN "→E", THEN "→E"] "&I" abs_β by blast
7009  qed
7010  ultimately AOT_show α (Universal(α) & β (Universal(β)  β = α))
7011    using "&I" "∃I" by fast
7012qed
7013
7014AOT_theorem "null-uni-uniq:3": ιx Null(x)
7015  using "A-Exists:2" "RA[2]" "≡E"(2) "null-uni-uniq:1" by blast
7016
7017AOT_theorem "null-uni-uniq:4": ιx Universal(x)
7018  using "A-Exists:2" "RA[2]" "≡E"(2) "null-uni-uniq:2" by blast
7019
7020AOT_define Null_object :: ‹κs (a)
7021  "df-null-uni-terms:1": a =df ιx Null(x)
7022
7023AOT_define Universal_object :: ‹κs (aV)
7024  "df-null-uni-terms:2": aV =df ιx Universal(x)
7025
7026AOT_theorem "null-uni-facts:1": Null(x)  Null(x)
7027proof (rule "→I")
7028  AOT_assume Null(x)
7029  AOT_hence x_abs: A!x and x_null: ¬F x[F]
7030    using "df-null-uni:1"[THEN "≡dfE"] "&E" by blast+
7031  AOT_have ¬x[F] for F using x_null
7032    using "existential:2[const_var]" "reductio-aa:1"
7033    by metis
7034  AOT_hence ¬x[F] for F by (metis "en-eq:7[1]" "≡E"(1))
7035  AOT_hence F ¬x[F] by (rule GEN)
7036  AOT_hence F ¬x[F] by (rule BF[THEN "→E"])
7037  moreover AOT_have F ¬x[F]  ¬F x[F]
7038    apply (rule RM)
7039    by (metis (full_types) "instantiation" "cqt:2[const_var]" "deduction-theorem"
7040                           "reductio-aa:1" "rule-ui:1" "vdash-properties:1[2]")
7041  ultimately AOT_have ¬F x[F]
7042    by (metis "→E")
7043  moreover AOT_have A!x using x_abs
7044    using "oa-facts:2" "vdash-properties:10" by blast
7045  ultimately AOT_have r: (A!x & ¬F x[F])
7046    by (metis "KBasic:3" "&I" "≡E"(3) "raa-cor:3")
7047  AOT_show Null(x)
7048    by (AOT_subst Null(x) A!x & ¬F x[F])
7049       (auto simp: "df-null-uni:1" "≡Df" r)
7050qed  
7051
7052AOT_theorem "null-uni-facts:2": Universal(x)  Universal(x)
7053proof (rule "→I")
7054  AOT_assume Universal(x)
7055  AOT_hence x_abs: A!x and x_univ: F x[F]
7056    using "df-null-uni:2"[THEN "≡dfE"] "&E" by blast+
7057  AOT_have x[F] for F using x_univ "∀E" by blast
7058  AOT_hence x[F] for F by (metis "en-eq:2[1]" "≡E"(1))
7059  AOT_hence F x[F] by (rule GEN)
7060  AOT_hence F x[F] by (rule BF[THEN "→E"])
7061  moreover AOT_have A!x using x_abs
7062    using "oa-facts:2" "vdash-properties:10" by blast
7063  ultimately AOT_have r: (A!x & F x[F])
7064    by (metis "KBasic:3" "&I" "≡E"(3) "raa-cor:3")
7065  AOT_show Universal(x)
7066    by (AOT_subst Universal(x) A!x & F x[F])
7067       (auto simp add: "df-null-uni:2" "≡Df" r)
7068qed
7069
7070AOT_theorem "null-uni-facts:3": Null(a)
7071  apply (rule "=dfI"(2)[OF "df-null-uni-terms:1"])
7072   apply (simp add: "null-uni-uniq:3")
7073  using "actual-desc:4"[THEN "→E", OF "null-uni-uniq:3"]
7074    "sc-eq-fur:2"[THEN "→E", OF "null-uni-facts:1"[unvarify x, THEN RN, OF "null-uni-uniq:3"], THEN "≡E"(1)]
7075  by blast
7076
7077AOT_theorem "null-uni-facts:4": Universal(aV)
7078  apply (rule "=dfI"(2)[OF "df-null-uni-terms:2"])
7079   apply (simp add: "null-uni-uniq:4")
7080  using "actual-desc:4"[THEN "→E", OF "null-uni-uniq:4"]
7081    "sc-eq-fur:2"[THEN "→E", OF "null-uni-facts:2"[unvarify x, THEN RN, OF "null-uni-uniq:4"], THEN "≡E"(1)]
7082  by blast
7083
7084AOT_theorem "null-uni-facts:5": a  aV
7085proof (rule "=dfI"(2)[OF "df-null-uni-terms:1", OF "null-uni-uniq:3"];
7086    rule "=dfI"(2)[OF "df-null-uni-terms:2", OF "null-uni-uniq:4"];
7087    rule "≡dfI"[OF "=-infix"];
7088    rule "raa-cor:2")
7089  AOT_obtain x where nullx: Null(x)
7090    by (metis "instantiation" "df-null-uni-terms:1" "existential:1" "null-uni-facts:3"
7091              "null-uni-uniq:3" "rule-id-df:2:b[zero]")
7092  AOT_hence act_null: 𝒜Null(x) by (metis "nec-imp-act" "null-uni-facts:1" "vdash-properties:10")
7093  AOT_assume ιx Null(x) = ιx Universal(x)
7094  AOT_hence 𝒜x(Null(x)  Universal(x))
7095    using "actual-desc:5"[THEN "→E"] by blast
7096  AOT_hence x 𝒜(Null(x)  Universal(x))
7097    by (metis "≡E"(1) "logic-actual-nec:3" "vdash-properties:1[2]")
7098  AOT_hence 𝒜Null(x)  𝒜Universal(x)
7099    using "Act-Basic:5" "≡E"(1) "rule-ui:3" by blast
7100  AOT_hence 𝒜Universal(x) using act_null "≡E" by blast
7101  AOT_hence Universal(x) by (metis RN "≡E"(1) "null-uni-facts:2" "sc-eq-fur:2" "vdash-properties:10")
7102  AOT_hence F x[F] using "≡dfE"[OF "df-null-uni:2"] "&E" by metis
7103  moreover AOT_have ¬F x[F] using nullx "≡dfE"[OF "df-null-uni:1"] "&E" by metis
7104  ultimately AOT_show p & ¬p for p by (metis "cqt-further:1" "raa-cor:3" "vdash-properties:10")
7105qed
7106
7107AOT_theorem "null-uni-facts:6": a = ιx(A!x & F (x[F]  F  F))
7108proof (rule "ab-obey:1"[unvarify x y, THEN "→E", THEN "→E"])
7109  AOT_show ιx([A!]x & F (x[F]  F  F))
7110    by (simp add: "A-descriptions")
7111next
7112  AOT_show a
7113    by (rule "=dfI"(2)[OF "df-null-uni-terms:1", OF "null-uni-uniq:3"])
7114       (simp add: "null-uni-uniq:3")
7115next
7116  AOT_have ιx([A!]x & F (x[F]  F  F))
7117    by (simp add: "A-descriptions")
7118  AOT_hence 1: ιx([A!]x & F (x[F]  F  F)) = ιx([A!]x & F (x[F]  F  F))
7119    using "rule=I:1" by blast
7120  AOT_show [A!]a & [A!]ιx([A!]x & F (x[F]  F  F))
7121    apply (rule "=dfI"(2)[OF "df-null-uni-terms:1", OF "null-uni-uniq:3"]; rule "&I")
7122    apply (meson "≡dfE" "Conjunction Simplification"(1) "df-null-uni:1" "df-null-uni-terms:1" "null-uni-facts:3" "null-uni-uniq:3" "rule-id-df:2:a[zero]" "vdash-properties:10")
7123    using "can-ab2"[unvarify y, OF "A-descriptions", THEN "→E", OF 1].
7124next
7125  AOT_show F (a[F]  ιx([A!]x & F (x[F]  F  F))[F])
7126  proof (rule GEN)
7127    fix F
7128    AOT_have ¬a[F]
7129      by (rule "=dfI"(2)[OF "df-null-uni-terms:1", OF "null-uni-uniq:3"])
7130         (metis (no_types, lifting) "≡dfE" "&E"(2) "∨I"(2) "∨E"(3)
7131                "df-null-uni:1" "df-null-uni-terms:1" "existential:2[const_var]" "null-uni-facts:3"
7132                "raa-cor:2" "rule-id-df:2:a[zero]" "russell-axiom[enc,1].ψ_denotes_asm")
7133    moreover AOT_have ¬ιx([A!]x & F (x[F]  F  F))[F]
7134    proof(rule "raa-cor:2")
7135      AOT_assume 0: ιx([A!]x & F (x[F]  F  F))[F]
7136      AOT_hence 𝒜(F  F) using "desc-nec-encode:2"[THEN "≡E"(1), OF 0] by blast
7137      moreover AOT_have ¬𝒜(F  F)
7138        using "≡dfE" "id-act:2" "id-eq:1" "≡E"(2) "=-infix" "raa-cor:3" by blast
7139      ultimately AOT_show 𝒜(F  F) & ¬𝒜(F  F) by (rule "&I")
7140    qed
7141    ultimately AOT_show a[F]  ιx([A!]x & F (x[F]  F  F))[F]
7142      using "deduction-theorem" "≡I" "raa-cor:4" by blast
7143  qed
7144qed
7145
7146AOT_theorem "null-uni-facts:7": aV = ιx(A!x & F (x[F]  F = F))
7147proof (rule "ab-obey:1"[unvarify x y, THEN "→E", THEN "→E"])
7148  AOT_show ιx([A!]x & F (x[F]  F = F))
7149    by (simp add: "A-descriptions")
7150next
7151  AOT_show aV
7152    by (rule "=dfI"(2)[OF "df-null-uni-terms:2", OF "null-uni-uniq:4"])
7153       (simp add: "null-uni-uniq:4")
7154next
7155  AOT_have ιx([A!]x & F (x[F]  F = F))
7156    by (simp add: "A-descriptions")
7157  AOT_hence 1: ιx([A!]x & F (x[F]  F = F)) = ιx([A!]x & F (x[F]  F = F))
7158    using "rule=I:1" by blast
7159  AOT_show [A!]aV & [A!]ιx([A!]x & F (x[F]  F = F))
7160    apply (rule "=dfI"(2)[OF "df-null-uni-terms:2", OF "null-uni-uniq:4"]; rule "&I")
7161    apply (meson "≡dfE" "Conjunction Simplification"(1) "df-null-uni:2" "df-null-uni-terms:2" "null-uni-facts:4" "null-uni-uniq:4" "rule-id-df:2:a[zero]" "vdash-properties:10")
7162    using "can-ab2"[unvarify y, OF "A-descriptions", THEN "→E", OF 1].
7163next
7164  AOT_show F (aV[F]  ιx([A!]x & F (x[F]  F = F))[F])
7165  proof (rule GEN)
7166    fix F
7167    AOT_have aV[F]
7168      apply (rule "=dfI"(2)[OF "df-null-uni-terms:2", OF "null-uni-uniq:4"])
7169      using "≡dfE" "&E"(2) "df-null-uni:2" "df-null-uni-terms:2" "null-uni-facts:4" "null-uni-uniq:4" "rule-id-df:2:a[zero]" "rule-ui:3" by blast
7170    moreover AOT_have ιx([A!]x & F (x[F]  F = F))[F]
7171      using "RA[2]" "desc-nec-encode:2" "id-eq:1" "≡E"(2) by fastforce
7172    ultimately AOT_show aV[F]  ιx([A!]x & F (x[F]  F = F))[F]
7173      using "deduction-theorem" "≡I" by simp
7174  qed
7175qed
7176
7177AOT_theorem "aclassical:1": Rxy(A!x & A!y & x  y & z [R]zx] = z [R]zy])
7178proof(rule GEN)
7179  fix R
7180  AOT_obtain a where a_prop: A!a & F (a[F]  y(A!y & F = z [R]zy] & ¬y[F]))
7181    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
7182  AOT_have a_enc: az [R]za]
7183  proof (rule "raa-cor:1")
7184    AOT_assume 0: ¬az [R]za]
7185    AOT_hence ¬y(A!y & z [R]za] = z [R]zy] & ¬yz [R]za])
7186      by (rule a_prop[THEN "&E"(2), THEN "∀E"(1)[where τ="«z [R]za]»"],
7187                THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated])
7188         "cqt:2[lambda]"
7189    AOT_hence y ¬(A!y & z [R]za] = z [R]zy] & ¬yz [R]za])
7190      using "cqt-further:4" "vdash-properties:10" by blast
7191    AOT_hence ¬(A!a & z [R]za] = z [R]za] & ¬az [R]za]) using "∀E" by blast
7192    AOT_hence (A!a & z [R]za] = z [R]za])  az [R]za]
7193      by (metis "&I" "deduction-theorem" "raa-cor:3")
7194    moreover AOT_have z [R]za] = z [R]za]
7195      by (rule "=I") "cqt:2[lambda]"
7196    ultimately AOT_have az [R]za] using a_prop[THEN "&E"(1)] "→E" "&I" by blast
7197    AOT_thus az [R]za] & ¬az [R]za]
7198      using 0 "&I" by blast
7199  qed
7200  AOT_hence y(A!y & z [R]za] = z [R]zy] & ¬yz [R]za])
7201    by (rule a_prop[THEN "&E"(2), THEN "∀E"(1), THEN "≡E"(1), rotated]) "cqt:2[lambda]"
7202  then AOT_obtain b where b_prop: A!b & z [R]za] = z [R]zb] & ¬bz [R]za]
7203    using "∃E"[rotated] by blast
7204  AOT_have a  b
7205    apply (rule "≡dfI"[OF "=-infix"])
7206    using a_enc b_prop[THEN "&E"(2)]
7207    using "¬¬I" "rule=E" id_sym "≡E"(4) "oth-class-taut:3:a" "raa-cor:3" "reductio-aa:1" by fast
7208  AOT_hence A!a & A!b & a  b & z [R]za] = z [R]zb]
7209    using b_prop "&E" a_prop "&I" by meson
7210  AOT_hence y (A!a & A!y & a  y & z [R]za] = z [R]zy]) by (rule "∃I")
7211  AOT_thus xy (A!x & A!y & x  y & z [R]zx] = z [R]zy]) by (rule "∃I")
7212qed
7213
7214AOT_theorem "aclassical:2": Rxy(A!x & A!y & x  y & z [R]xz] = z [R]yz])
7215proof(rule GEN)
7216  fix R
7217  AOT_obtain a where a_prop: A!a & F (a[F]  y(A!y & F = z [R]yz] & ¬y[F]))
7218    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
7219  AOT_have a_enc: az [R]az]
7220  proof (rule "raa-cor:1")
7221    AOT_assume 0: ¬az [R]az]
7222    AOT_hence ¬y(A!y & z [R]az] = z [R]yz] & ¬yz [R]az])
7223      by (rule a_prop[THEN "&E"(2), THEN "∀E"(1)[where τ="«z [R]az]»"],
7224                THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated])
7225         "cqt:2[lambda]"
7226    AOT_hence y ¬(A!y & z [R]az] = z [R]yz] & ¬yz [R]az])
7227      using "cqt-further:4" "vdash-properties:10" by blast
7228    AOT_hence ¬(A!a & z [R]az] = z [R]az] & ¬az [R]az]) using "∀E" by blast
7229    AOT_hence (A!a & z [R]az] = z [R]az])  az [R]az]
7230      by (metis "&I" "deduction-theorem" "raa-cor:3")
7231    moreover AOT_have z [R]az] = z [R]az]
7232      by (rule "=I") "cqt:2[lambda]"
7233    ultimately AOT_have az [R]az] using a_prop[THEN "&E"(1)] "→E" "&I" by blast
7234    AOT_thus az [R]az] & ¬az [R]az]
7235      using 0 "&I" by blast
7236  qed
7237  AOT_hence y(A!y & z [R]az] = z [R]yz] & ¬yz [R]az])
7238    by (rule a_prop[THEN "&E"(2), THEN "∀E"(1), THEN "≡E"(1), rotated]) "cqt:2[lambda]"
7239  then AOT_obtain b where b_prop: A!b & z [R]az] = z [R]bz] & ¬bz [R]az]
7240    using "∃E"[rotated] by blast
7241  AOT_have a  b
7242    apply (rule "≡dfI"[OF "=-infix"])
7243    using a_enc b_prop[THEN "&E"(2)]
7244    using "¬¬I" "rule=E" id_sym "≡E"(4) "oth-class-taut:3:a" "raa-cor:3" "reductio-aa:1" by fast
7245  AOT_hence A!a & A!b & a  b & z [R]az] = z [R]bz]
7246    using b_prop "&E" a_prop "&I" by meson
7247  AOT_hence y (A!a & A!y & a  y & z [R]az] = z [R]yz]) by (rule "∃I")
7248  AOT_thus xy (A!x & A!y & x  y & z [R]xz] = z [R]yz]) by (rule "∃I")
7249qed
7250
7251AOT_theorem "aclassical:3": Fxy(A!x & A!y & x  y &  [F]x] =  [F]y])
7252proof(rule GEN)
7253  fix R
7254  AOT_obtain a where a_prop: A!a & F (a[F]  y(A!y & F = z [R]y] & ¬y[F]))
7255    using "A-objects"[axiom_inst] "∃E"[rotated] by fast
7256  AOT_have z [R]a] by "cqt:2[lambda]"
7257  (* TODO: S should no longer be necessary *)
7258  then AOT_obtain S where S_def: S = z [R]a]
7259    by (metis "instantiation" "rule=I:1" "existential:1" id_sym)
7260  AOT_have a_enc: a[S]
7261  proof (rule "raa-cor:1")
7262    AOT_assume 0: ¬a[S]
7263    AOT_hence ¬y(A!y & S = z [R]y] & ¬y[S])
7264      by (rule a_prop[THEN "&E"(2), THEN "∀E"(2)[where β=S],
7265                THEN "oth-class-taut:4:b"[THEN "≡E"(1)], THEN "≡E"(1), rotated]) 
7266    AOT_hence y ¬(A!y & S = z [R]y] & ¬y[S])
7267      using "cqt-further:4" "vdash-properties:10" by blast
7268    AOT_hence ¬(A!a & S = z [R]a] & ¬a[S]) using "∀E" by blast
7269    AOT_hence (A!a & S = z [R]a])  a[S]
7270      by (metis "&I" "deduction-theorem" "raa-cor:3")
7271    moreover AOT_have S = z [R]a] using S_def .
7272    ultimately AOT_have a[S] using a_prop[THEN "&E"(1)] "→E" "&I" by blast
7273    AOT_thus az [R]a] & ¬az [R]a]  by (metis "0" "raa-cor:3") 
7274  qed
7275  AOT_hence y(A!y & S = z [R]y] & ¬y[S])
7276    by (rule a_prop[THEN "&E"(2), THEN "∀E"(2), THEN "≡E"(1), rotated])
7277  then AOT_obtain b where b_prop: A!b & S = z [R]b] & ¬b[S]
7278    using "∃E"[rotated] by blast
7279  AOT_have 1: a  b
7280    apply (rule "≡dfI"[OF "=-infix"])
7281    using a_enc b_prop[THEN "&E"(2)]
7282    using "¬¬I" "rule=E" id_sym "≡E"(4) "oth-class-taut:3:a" "raa-cor:3" "reductio-aa:1" by fast
7283  AOT_have a:  [R]a] = ([R]a)
7284    apply (rule "lambda-predicates:3[zero]"[axiom_inst, unvarify p])
7285    by (meson "log-prop-prop:2")
7286  AOT_have b:  [R]b] = ([R]b)
7287    apply (rule "lambda-predicates:3[zero]"[axiom_inst, unvarify p])
7288    by (meson "log-prop-prop:2")
7289  AOT_have  [R]a] =  [R]b]
7290    apply (rule "rule=E"[rotated, OF a[THEN id_sym]])
7291    apply (rule "rule=E"[rotated, OF b[THEN id_sym]])
7292    apply (rule "identity:4"[THEN "≡dfI", OF "&I", rotated])
7293     apply (rule "rule=E"[rotated, OF S_def])
7294    using b_prop "&E" apply blast
7295    apply (safe intro!: "&I")
7296    by (simp add: "log-prop-prop:2")+
7297  AOT_hence A!a & A!b & a  b &  [R]a] =  [R]b]
7298    using 1 a_prop[THEN "&E"(1)] b_prop[THEN "&E"(1), THEN "&E"(1)] "&I" by auto
7299  AOT_hence y (A!a & A!y & a  y &  [R]a] =  [R]y]) by (rule "∃I")
7300  AOT_thus xy (A!x & A!y & x  y &  [R]x] =  [R]y]) by (rule "∃I")
7301qed
7302
7303AOT_theorem aclassical2: xy (A!x & A!y & x  y & F ([F]x  [F]y))
7304proof -
7305  AOT_have x y ([A!]x & [A!]y & x  y &
7306               z xy F ([F]x  [F]y)]zx] = z xy F ([F]x  [F]y)]zy])
7307    by (rule "aclassical:1"[THEN "∀E"(1)[where τ="«xy F ([F]x  [F]y)]»"]])
7308       "cqt:2[lambda]"
7309  then AOT_obtain x where y ([A!]x & [A!]y & x  y &
7310               z xy F ([F]x  [F]y)]zx] = z xy F ([F]x  [F]y)]zy])
7311    using "∃E"[rotated] by blast
7312  then AOT_obtain y where 0: ([A!]x & [A!]y & x  y &
7313               z xy F ([F]x  [F]y)]zx] = z xy F ([F]x  [F]y)]zy])
7314    using "∃E"[rotated] by blast
7315  AOT_have z xy F ([F]x  [F]y)]zx]x
7316    apply (rule "β←C"(1))
7317      apply "cqt:2[lambda]"
7318     apply (fact "cqt:2[const_var]"[axiom_inst])
7319    apply (rule "β←C"(1))
7320      apply "cqt:2[lambda]"
7321    apply (simp add: "&I" "ex:1:a" prod_denotesI "rule-ui:3")
7322    by (simp add: "oth-class-taut:3:a" "universal-cor")
7323  AOT_hence z xy F ([F]x  [F]y)]zy]x
7324    by (rule "rule=E"[rotated, OF 0[THEN "&E"(2)]])
7325  AOT_hence xy F ([F]x  [F]y)]xy
7326    by (rule "β→C"(1))
7327  AOT_hence F ([F]x  [F]y)
7328    using "β→C"(1) old.prod.case by fast
7329  AOT_hence [A!]x & [A!]y & x  y & F ([F]x  [F]y) using 0 "&E" "&I" by blast
7330  AOT_hence y ([A!]x & [A!]y & x  y & F ([F]x  [F]y)) by (rule "∃I")
7331  AOT_thus xy ([A!]x & [A!]y & x  y & F ([F]x  [F]y)) by (rule "∃I"(2))
7332qed
7333
7334AOT_theorem "kirchner-thm:1": x φ{x}]  xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7335proof(rule "≡I"; rule "→I")
7336  AOT_assume x φ{x}]
7337  AOT_hence x φ{x}] by (metis "exist-nec" "vdash-properties:10")
7338  moreover AOT_have x φ{x}]  xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7339  proof (rule "RM:1"; rule "→I"; rule GEN; rule GEN; rule "→I")
7340    AOT_modally_strict {
7341      fix x y
7342      AOT_assume 0: x φ{x}]
7343      moreover AOT_assume F([F]x  [F]y)
7344      ultimately AOT_have x φ{x}]x  x φ{x}]y
7345        using "∀E" by blast
7346      AOT_thus (φ{x}  φ{y})
7347        using "beta-C-meta"[THEN "→E", OF 0] "≡E"(6) by meson
7348    }
7349  qed
7350  ultimately AOT_show xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7351    using "→E" by blast
7352next
7353  AOT_have xy(F([F]x  [F]y)  (φ{x}  φ{y}))  y(x(F([F]x  [F]y) & φ{x})  φ{y})
7354  proof(rule "RM:1"; rule "→I"; rule GEN)
7355    AOT_modally_strict {
7356      AOT_assume xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7357      AOT_hence indisc: φ{x}  φ{y} if F([F]x  [F]y) for x y
7358        using "∀E"(2) "→E" that by blast
7359      AOT_show (x(F([F]x  [F]y) & φ{x})  φ{y}) for y
7360      proof (rule "raa-cor:1")
7361        AOT_assume ¬(x(F([F]x  [F]y) & φ{x})  φ{y})
7362        AOT_hence (x(F([F]x  [F]y) & φ{x}) & ¬φ{y})  (¬(x(F([F]x  [F]y) & φ{x})) & φ{y})
7363          using "≡E"(1) "oth-class-taut:4:h" by blast
7364        moreover {
7365          AOT_assume 0: x(F([F]x  [F]y) & φ{x}) & ¬φ{y}
7366          AOT_obtain a where F([F]a  [F]y) & φ{a}
7367            using "∃E"[rotated, OF 0[THEN "&E"(1)]]  by blast
7368          AOT_hence φ{y} using indisc[THEN "≡E"(1)] "&E" by blast
7369          AOT_hence p & ¬p for p using 0[THEN "&E"(2)] "&I" "raa-cor:3" by blast
7370        }
7371        moreover {
7372          AOT_assume 0: (¬(x(F([F]x  [F]y) & φ{x})) & φ{y})
7373          AOT_hence x ¬(F([F]x  [F]y) & φ{x})
7374            using "&E"(1) "cqt-further:4" "→E" by blast
7375          AOT_hence ¬(F([F]y  [F]y) & φ{y}) using "∀E" by blast
7376          AOT_hence ¬F([F]y  [F]y)  ¬φ{y}
7377            using "≡E"(1) "oth-class-taut:5:c" by blast
7378          moreover AOT_have F([F]y  [F]y) by (simp add: "oth-class-taut:3:a" "universal-cor")
7379          ultimately AOT_have ¬φ{y} by (metis "¬¬I" "∨E"(2))
7380          AOT_hence p & ¬p for p using 0[THEN "&E"(2)] "&I" "raa-cor:3" by blast
7381        }
7382        ultimately AOT_show p & ¬p for p using "∨E"(3) "raa-cor:1" by blast
7383      qed
7384    }
7385  qed
7386  moreover AOT_assume xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7387  ultimately AOT_have y(x(F([F]x  [F]y) & φ{x})  φ{y})
7388    using "→E" by blast
7389  AOT_thus x φ{x}]
7390    by (rule "safe-ext"[axiom_inst, THEN "→E", OF "&I", rotated]) "cqt:2[lambda]"
7391qed
7392
7393AOT_theorem "kirchner-thm:2": x1...xn φ{x1...xn}]  x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7394proof(rule "≡I"; rule "→I")
7395  AOT_assume x1...xn φ{x1...xn}]
7396  AOT_hence x1...xn φ{x1...xn}] by (metis "exist-nec" "vdash-properties:10")
7397  moreover AOT_have x1...xn φ{x1...xn}]  x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7398  proof (rule "RM:1"; rule "→I"; rule GEN; rule GEN; rule "→I")
7399    AOT_modally_strict {
7400      fix x1xn y1yn :: 'a AOT_var›
7401      AOT_assume 0: x1...xn φ{x1...xn}]
7402      moreover AOT_assume F([F]x1...xn  [F]y1...yn)
7403      ultimately AOT_have x1...xn φ{x1...xn}]x1...xn  x1...xn φ{x1...xn}]y1...yn
7404        using "∀E" by blast
7405      AOT_thus (φ{x1...xn}  φ{y1...yn})
7406        using "beta-C-meta"[THEN "→E", OF 0] "≡E"(6) by meson
7407    }
7408  qed
7409  ultimately AOT_show x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7410    using "→E" by blast
7411next
7412  AOT_have (x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))) 
7413            y1...∀yn((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))  φ{y1...yn})
7414  proof(rule "RM:1"; rule "→I"; rule GEN)
7415    AOT_modally_strict {
7416      AOT_assume x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7417      AOT_hence indisc: φ{x1...xn}  φ{y1...yn} if F([F]x1...xn  [F]y1...yn) for x1xn y1yn
7418        using "∀E"(2) "→E" that by blast
7419      AOT_show (x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))  φ{y1...yn} for y1yn
7420      proof (rule "raa-cor:1")
7421        AOT_assume ¬((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))  φ{y1...yn})
7422        AOT_hence ((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn})) & ¬φ{y1...yn}) 
7423                    (¬(x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn})) & φ{y1...yn})
7424          using "≡E"(1) "oth-class-taut:4:h" by blast
7425        moreover {
7426          AOT_assume 0: (x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn})) & ¬φ{y1...yn}
7427          AOT_obtain a1an where F([F]a1...an  [F]y1...yn) & φ{a1...an}
7428            using "∃E"[rotated, OF 0[THEN "&E"(1)]]  by blast
7429          AOT_hence φ{y1...yn} using indisc[THEN "≡E"(1)] "&E" by blast
7430          AOT_hence p & ¬p for p using 0[THEN "&E"(2)] "&I" "raa-cor:3" by blast
7431        }
7432        moreover {
7433          AOT_assume 0: (¬((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))) & φ{y1...yn})
7434          AOT_hence x1...∀xn ¬(F([F]x1...xn  [F]y1...yn) & φ{x1...xn})
7435            using "&E"(1) "cqt-further:4" "→E" by blast
7436          AOT_hence ¬(F([F]y1...yn  [F]y1...yn) & φ{y1...yn}) using "∀E" by blast
7437          AOT_hence ¬F([F]y1...yn  [F]y1...yn)  ¬φ{y1...yn}
7438            using "≡E"(1) "oth-class-taut:5:c" by blast
7439          moreover AOT_have F([F]y1...yn  [F]y1...yn)
7440            by (simp add: "oth-class-taut:3:a" "universal-cor")
7441          ultimately AOT_have ¬φ{y1...yn} by (metis "¬¬I" "∨E"(2))
7442          AOT_hence p & ¬p for p using 0[THEN "&E"(2)] "&I" "raa-cor:3" by blast
7443        }
7444        ultimately AOT_show p & ¬p for p using "∨E"(3) "raa-cor:1" by blast
7445      qed
7446    }
7447  qed
7448  moreover AOT_assume x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7449  ultimately AOT_have y1...∀yn((x1...∃xn(F([F]x1...xn  [F]y1...yn) & φ{x1...xn}))  φ{y1...yn})
7450    using "→E" by blast
7451  AOT_thus x1...xn φ{x1...xn}]
7452    by (rule "safe-ext"[axiom_inst, THEN "→E", OF "&I", rotated]) "cqt:2[lambda]"
7453qed
7454
7455AOT_theorem "kirchner-thm-cor:1": x φ{x}]  xy(F([F]x  [F]y)  (φ{x}  φ{y}))
7456proof(rule "→I"; rule GEN; rule GEN; rule "→I")
7457  fix x y
7458  AOT_assume x φ{x}]
7459  AOT_hence xy (F ([F]x  [F]y)  (φ{x}  φ{y}))
7460    by (rule "kirchner-thm:1"[THEN "≡E"(1)])
7461  AOT_hence xy (F ([F]x  [F]y)  (φ{x}  φ{y}))
7462    using CBF[THEN "→E"] by blast
7463  AOT_hence y (F ([F]x  [F]y)  (φ{x}  φ{y}))
7464    using "∀E" by blast
7465  AOT_hence y (F ([F]x  [F]y)  (φ{x}  φ{y}))
7466    using CBF[THEN "→E"] by blast
7467  AOT_hence (F ([F]x  [F]y)  (φ{x}  φ{y}))
7468    using "∀E" by blast
7469  AOT_hence F ([F]x  [F]y)  (φ{x}  φ{y})
7470    using "qml:1"[axiom_inst] "vdash-properties:6" by blast
7471  moreover AOT_assume F([F]x  [F]y)
7472  ultimately AOT_show (φ{x}  φ{y}) using "→E" "ind-nec" by blast
7473qed
7474
7475AOT_theorem "kirchner-thm-cor:2":
7476  x1...xn φ{x1...xn}]  x1...∀xny1...∀yn(F([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7477proof(rule "→I"; rule GEN; rule GEN; rule "→I")
7478  fix x1xn y1yn
7479  AOT_assume x1...xn φ{x1...xn}]
7480  AOT_hence 0: x1...∀xny1...∀yn (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7481    by (rule "kirchner-thm:2"[THEN "≡E"(1)])
7482  AOT_have x1...∀xny1...∀yn (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7483  proof(rule GEN; rule GEN)
7484    fix x1xn y1yn
7485    AOT_show (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7486      apply (rule "RM:1"[THEN "→E", rotated, OF 0]; rule "→I")
7487      using "∀E" by blast
7488  qed
7489  AOT_hence y1...∀yn (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7490    using "∀E" by blast
7491  AOT_hence (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7492    using "∀E" by blast
7493  AOT_hence (F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn}))
7494    using "∀E" by blast
7495  AOT_hence 0: F ([F]x1...xn  [F]y1...yn)  (φ{x1...xn}  φ{y1...yn})
7496    using "qml:1"[axiom_inst] "vdash-properties:6" by blast
7497  moreover AOT_assume F([F]x1...xn  [F]y1...yn)
7498  moreover AOT_have x1...xn F ([F]x1...xn  [F]y1...yn)] by "cqt:2[lambda]"
7499  ultimately AOT_have x1...xn F ([F]x1...xn  [F]y1...yn)]x1...xn  x1...xn F ([F]x1...xn  [F]y1...yn)]y1...yn
7500    using "∀E" by blast
7501  moreover AOT_have x1...xn F ([F]x1...xn  [F]y1...yn)]y1...yn
7502    apply (rule "β←C"(1))
7503      apply "cqt:2[lambda]"
7504     apply (fact "cqt:2[const_var]"[axiom_inst])
7505    by (simp add: RN GEN "oth-class-taut:3:a")
7506  ultimately AOT_have x1...xn F ([F]x1...xn  [F]y1...yn)]x1...xn using "≡E"(2) by blast
7507  AOT_hence F ([F]x1...xn  [F]y1...yn)
7508    using "β→C"(1) by blast
7509  AOT_thus (φ{x1...xn}  φ{y1...yn}) using "→E" 0 by blast
7510qed
7511
7512AOT_define propositional :: ‹Π  φ› (Propositional'(_'))
7513  "prop-prop1": Propositional([F]) df p(F = y p])
7514
7515AOT_theorem "prop-prop2:1": p y p]
7516  by (rule GEN) "cqt:2[lambda]"
7517
7518AOT_theorem "prop-prop2:2": ν φ]
7519  by "cqt:2[lambda]"
7520
7521AOT_theorem "prop-prop2:3": F = y p]  x([F]x  p)
7522proof (rule "→I")
7523  AOT_assume 0: F = y p]
7524  AOT_show x([F]x  p)
7525    by (rule "rule=E"[rotated, OF 0[symmetric]]; rule RN; rule GEN; rule "beta-C-meta"[THEN "→E"])
7526      "cqt:2[lambda]"
7527qed
7528
7529AOT_theorem "prop-prop2:4": Propositional([F])  Propositional([F])
7530proof(rule "→I")
7531  AOT_assume Propositional([F])
7532  AOT_hence p(F = y p]) using "≡dfE"[OF "prop-prop1"] by blast
7533  then AOT_obtain p where F = y p] using "∃E"[rotated] by blast
7534  AOT_hence (F = y p]) using "id-nec:2" "modus-tollens:1" "raa-cor:3" by blast
7535  AOT_hence p (F = y p]) using "∃I" by fast
7536  AOT_hence 0: p (F = y p]) by (metis Buridan "vdash-properties:10")
7537  AOT_thus Propositional([F])
7538    using "prop-prop1"[THEN "≡Df"]
7539    by (AOT_subst Propositional([F]) p (F = y p])) auto
7540qed
7541
7542AOT_define indicriminate :: ‹Π  φ› ("Indiscriminate'(_')")
7543  "prop-indis": Indiscriminate([F]) df F & (x [F]x  x [F]x)
7544
7545AOT_theorem "prop-in-thm": Propositional([Π])  Indiscriminate([Π])
7546proof(rule "→I")
7547  AOT_assume Propositional([Π])
7548  AOT_hence p Π = y p] using "≡dfE"[OF "prop-prop1"] by blast
7549  then AOT_obtain p where Π_def: Π = y p] using "∃E"[rotated] by blast
7550  AOT_show Indiscriminate([Π])
7551  proof (rule "≡dfI"[OF "prop-indis"]; rule "&I")
7552    AOT_show Π
7553      using Π_def by (meson "t=t-proper:1" "vdash-properties:6")
7554  next
7555    AOT_show (x [Π]x  x [Π]x)
7556    proof (rule "rule=E"[rotated, OF Π_def[symmetric]]; rule RN; rule "→I"; rule GEN)
7557      AOT_modally_strict {
7558        AOT_assume x y p]x
7559        then AOT_obtain a where y p]a using "∃E"[rotated] by blast
7560        AOT_hence 0: p by (metis "β→C"(1))
7561        AOT_show y p]x for x
7562          apply (rule "β←C"(1))
7563            apply "cqt:2[lambda]"
7564           apply (fact "cqt:2[const_var]"[axiom_inst])
7565          by (fact 0)
7566      }
7567    qed
7568  qed
7569qed
7570
7571AOT_theorem "prop-in-f:1": Necessary([F])  Indiscriminate([F])
7572proof (rule "→I")
7573  AOT_assume Necessary([F])
7574  AOT_hence 0: x1...∀xn [F]x1...xn using "≡dfE"[OF "contingent-properties:1"] by blast
7575  AOT_show Indiscriminate([F])
7576    by (rule "≡dfI"[OF "prop-indis"])
7577       (metis "0" "KBasic:1" "&I" "ex:1:a" "rule-ui:2[const_var]" "vdash-properties:6") 
7578qed
7579
7580AOT_theorem "prop-in-f:2": Impossible([F])  Indiscriminate([F])
7581proof (rule "→I")
7582  AOT_modally_strict {
7583    AOT_have x ¬[F]x  (x [F]x  x [F]x)
7584      by (metis "instantiation" "cqt-orig:3" "Hypothetical Syllogism" "deduction-theorem" "raa-cor:3")
7585  }
7586  AOT_hence 0: x ¬[F]x  (x [F]x  x [F]x)
7587    by (rule "RM:1")
7588  AOT_assume Impossible([F])
7589  AOT_hence x ¬[F]x using "≡dfE"[OF "contingent-properties:2"] "&E" by blast
7590  AOT_hence 1: (x [F]x  x [F]x) using 0 "→E" by blast
7591  AOT_show Indiscriminate([F])
7592    by (rule "≡dfI"[OF "prop-indis"]; rule "&I")
7593       (simp add: "ex:1:a" "rule-ui:2[const_var]" 1)+
7594qed
7595
7596AOT_theorem "prop-in-f:3:a": ¬Indiscriminate([E!])
7597proof(rule "raa-cor:2")
7598  AOT_assume Indiscriminate([E!])
7599  AOT_hence 0: (x [E!]x  x [E!]x)
7600    using "≡dfE"[OF "prop-indis"] "&E" by blast
7601  AOT_hence x [E!]x  x [E!]x
7602    using "KBasic:13" "vdash-properties:10" by blast
7603  moreover AOT_have x [E!]x
7604    by (simp add: "thm-cont-e:3")
7605  ultimately AOT_have x [E!]x
7606    by (metis "vdash-properties:6")
7607  AOT_thus p & ¬p for p
7608    by (metis "≡dfE" "conventions:5" "o-objects-exist:5" "reductio-aa:1")
7609qed
7610
7611AOT_theorem "prop-in-f:3:b": ¬Indiscriminate([E!]-)
7612proof (rule "rule=E"[rotated, OF "rel-neg-T:2"[symmetric]]; rule "raa-cor:2")
7613  AOT_assume Indiscriminate(x ¬[E!]x])
7614  AOT_hence 0: (x x ¬[E!]x]x  x x ¬[E!]x]x)
7615    using "≡dfE"[OF "prop-indis"] "&E" by blast
7616  AOT_hence x x ¬[E!]x]x  x x ¬[E!]x]x
7617    using "→E" "qml:1" "vdash-properties:1[2]" by blast
7618  moreover AOT_have x x ¬[E!]x]x
7619    apply (AOT_subst x ¬E!x]x ¬E!x bound: x)
7620    apply (rule "beta-C-meta"[THEN "→E"])
7621     apply "cqt:2[lambda]"
7622    by (metis (full_types) "B◇" RN "T◇" "cqt-further:2" "o-objects-exist:5" "vdash-properties:10")
7623  ultimately AOT_have 1: x x ¬[E!]x]x
7624    by (metis "vdash-properties:6")
7625  AOT_hence x ¬[E!]x
7626    by (AOT_subst (reverse) ¬[E!]x  x ¬[E!]x]x bound: x)
7627       (auto intro!: "cqt:2" "beta-C-meta"[THEN "→E"])
7628  AOT_hence x ¬[E!]x by (metis "CBF" "vdash-properties:10")
7629  moreover AOT_obtain a where abs_a: O!a
7630    using "instantiation" "o-objects-exist:1" "qml:2" "vdash-properties:1[2]" "vdash-properties:6" by blast
7631  ultimately AOT_have ¬[E!]a using "∀E" by blast
7632  AOT_hence 2: ¬[E!]a by (metis "≡dfE" "conventions:5" "reductio-aa:1")
7633  AOT_have A!a
7634    apply (rule "=dfI"(2)[OF AOT_abstract])
7635     apply "cqt:2[lambda]"
7636    apply (rule "β←C"(1))
7637      apply "cqt:2[lambda]"
7638    using "cqt:2[const_var]"[axiom_inst] apply blast
7639    by (fact 2)
7640  AOT_thus p & ¬p for p using abs_a
7641    by (metis "≡E"(1) "oa-contingent:2" "reductio-aa:1")
7642qed
7643
7644AOT_theorem "prop-in-f:3:c": ¬Indiscriminate(O!)
7645proof(rule "raa-cor:2")
7646  AOT_assume Indiscriminate(O!)
7647  AOT_hence 0: (x O!x  x O!x)
7648    using "≡dfE"[OF "prop-indis"] "&E" by blast
7649  AOT_hence x O!x  x O!x
7650    using "qml:1"[axiom_inst] "vdash-properties:6" by blast
7651  moreover AOT_have x O!x
7652    using "o-objects-exist:1" by blast
7653  ultimately AOT_have x O!x
7654    by (metis "vdash-properties:6")
7655  AOT_thus p & ¬p for p
7656    by (metis "o-objects-exist:3" "qml:2" "raa-cor:3" "vdash-properties:10" "vdash-properties:1[2]")
7657qed
7658
7659AOT_theorem "prop-in-f:3:d": ¬Indiscriminate(A!)
7660proof(rule "raa-cor:2")
7661  AOT_assume Indiscriminate(A!)
7662  AOT_hence 0: (x A!x  x A!x)
7663    using "≡dfE"[OF "prop-indis"] "&E" by blast
7664  AOT_hence x A!x  x A!x
7665    using "qml:1"[axiom_inst] "vdash-properties:6" by blast
7666  moreover AOT_have x A!x
7667    using "o-objects-exist:2" by blast
7668  ultimately AOT_have x A!x
7669    by (metis "vdash-properties:6")
7670  AOT_thus p & ¬p for p
7671    by (metis "o-objects-exist:4" "qml:2" "raa-cor:3" "vdash-properties:10" "vdash-properties:1[2]")
7672qed
7673
7674AOT_theorem "prop-in-f:4:a": ¬Propositional(E!)
7675  using "modus-tollens:1" "prop-in-f:3:a" "prop-in-thm" by blast
7676
7677AOT_theorem "prop-in-f:4:b": ¬Propositional(E!-)
7678  using "modus-tollens:1" "prop-in-f:3:b" "prop-in-thm" by blast
7679
7680AOT_theorem "prop-in-f:4:c": ¬Propositional(O!)
7681  using "modus-tollens:1" "prop-in-f:3:c" "prop-in-thm" by blast
7682
7683AOT_theorem "prop-in-f:4:d": ¬Propositional(A!)
7684  using "modus-tollens:1" "prop-in-f:3:d" "prop-in-thm" by blast
7685
7686AOT_theorem "prop-prop-nec:1": p (F = y p])  p(F = y p])
7687proof(rule "→I")
7688  AOT_assume p (F = y p])
7689  AOT_hence p (F = y p])
7690    by (metis "BF◇" "vdash-properties:10")
7691  then AOT_obtain p where (F = y p]) using "∃E"[rotated] by blast
7692  AOT_hence F = y p] by (metis "derived-S5-rules:2" emptyE "id-nec:2" "vdash-properties:6")
7693  AOT_thus p(F = y p]) by (rule "∃I")
7694qed
7695
7696AOT_theorem "prop-prop-nec:2": p (F  y p])  p(F  y p])
7697proof(rule "→I")
7698  AOT_assume p (F  y p])
7699  AOT_hence (F  y p]) for p
7700    using "∀E" by blast
7701  AOT_hence (F  y p]) for p
7702    by (rule "id-nec2:2"[unvarify β, THEN "→E", rotated]) "cqt:2[lambda]"
7703  AOT_hence p (F  y p]) by (rule GEN)
7704  AOT_thus p (F  y p]) using BF[THEN "→E"] by fast
7705qed
7706
7707AOT_theorem "prop-prop-nec:3": p (F = y p])  p(F = y p])
7708proof(rule "→I")
7709  AOT_assume p (F = y p])
7710  then AOT_obtain p where (F = y p]) using "∃E"[rotated] by blast
7711  AOT_hence (F = y p]) by (metis "id-nec:2" "vdash-properties:6")
7712  AOT_hence p(F = y p]) by (rule "∃I")
7713  AOT_thus p(F = y p]) by (metis Buridan "vdash-properties:10")
7714qed
7715
7716AOT_theorem "prop-prop-nec:4": p (F  y p])  p(F  y p])
7717proof(rule "→I")
7718  AOT_assume p (F  y p])
7719  AOT_hence p (F  y p]) by (metis "Buridan◇" "vdash-properties:10")
7720  AOT_hence (F  y p]) for p
7721    using "∀E" by blast
7722  AOT_hence F  y p] for p
7723    by (rule "id-nec2:3"[unvarify β, THEN "→E", rotated]) "cqt:2[lambda]"
7724  AOT_thus p (F  y p]) by (rule GEN)
7725qed
7726
7727AOT_theorem "enc-prop-nec:1": F (x[F]  p(F = y p]))  F(x[F]  p (F = y p]))
7728proof(rule "→I"; rule GEN; rule "→I")
7729  fix F
7730  AOT_assume F (x[F]  p(F = y p]))
7731  AOT_hence F (x[F]  p(F = y p]))
7732    using "Buridan◇" "vdash-properties:10" by blast
7733  AOT_hence 0: (x[F]  p(F = y p])) using "∀E" by blast
7734  AOT_assume x[F]
7735  AOT_hence x[F] by (metis "en-eq:2[1]" "≡E"(1))
7736  AOT_hence p(F = y p])
7737    using 0 by (metis "KBasic2:4" "≡E"(1) "vdash-properties:10")
7738  AOT_thus p(F = y p])
7739    using "prop-prop-nec:1"[THEN "→E"] by blast
7740qed
7741
7742AOT_theorem "enc-prop-nec:2": F (x[F]  p(F = y p]))  F(x[F]  p (F = y p]))
7743  using "derived-S5-rules:1"[where Γ="{}", simplified, OF "enc-prop-nec:1"]
7744  by blast
7745
7746(*<*)
7747end
7748(*>*)